<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Clojure, the REPL and test-driven development</title>
	<atom:link href="http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/</link>
	<description>Amit Rathore blogs about software development</description>
	<lastBuildDate>Tue, 17 Jan 2012 17:58:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Andreas Brenk</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-352</link>
		<dc:creator><![CDATA[Andreas Brenk]]></dc:creator>
		<pubDate>Tue, 16 Feb 2010 22:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-352</guid>
		<description><![CDATA[There&#039;s &lt;a href=&quot;http://vimeo.com/9350864&quot; rel=&quot;nofollow&quot;&gt;a nice screencast of TDD development in Clojure&lt;/a&gt;.]]></description>
		<content:encoded><![CDATA[<p>There&#8217;s <a href="http://vimeo.com/9350864" rel="nofollow">a nice screencast of TDD development in Clojure</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi Mohan</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-288</link>
		<dc:creator><![CDATA[Ravi Mohan]]></dc:creator>
		<pubDate>Wed, 05 Aug 2009 09:29:42 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-288</guid>
		<description><![CDATA[Ahh but whatever happened to &quot;TDD is  about *design* not testing&quot; bit of  agile dogma? 

Ok that wasn&#039;t a serious question and not aimed at Amit - I&#039;ve been hearing this from so called &quot;agile&quot; folks for some time now and couldn&#039;t resist, but snark aside,

TDD has always had a dual purpose - (1) as a design method - I&#039;ve long been dubious of this  and (2) as a way of building up a regression suite.

(2) is still valuable, though you don&#039;t really need the &quot;DD&quot; part of TDD to get the benefits. You can just save your REPL tests, whether written first, last or in the middle, or while bug fixing (as Amit points out). 

That said, I hereby take this opportunity spit on  TDD as a design method. Referential Transparency helps in avoding the &quot;DD&quot; part of TDD, but even in OO/imperative designs, I&#039;d rather substitute thinking for  TDD. I&#039;ve had to fix too many code bases &quot;designed&quot; through TDD.

 Wonder of wonders, a lot of people do good design by thinking (deeply) about the issue at hand without resorting to crutches like TDD. Rich Hickey is a great example.]]></description>
		<content:encoded><![CDATA[<p>Ahh but whatever happened to &#8220;TDD is  about *design* not testing&#8221; bit of  agile dogma? </p>
<p>Ok that wasn&#8217;t a serious question and not aimed at Amit &#8211; I&#8217;ve been hearing this from so called &#8220;agile&#8221; folks for some time now and couldn&#8217;t resist, but snark aside,</p>
<p>TDD has always had a dual purpose &#8211; (1) as a design method &#8211; I&#8217;ve long been dubious of this  and (2) as a way of building up a regression suite.</p>
<p>(2) is still valuable, though you don&#8217;t really need the &#8220;DD&#8221; part of TDD to get the benefits. You can just save your REPL tests, whether written first, last or in the middle, or while bug fixing (as Amit points out). </p>
<p>That said, I hereby take this opportunity spit on  TDD as a design method. Referential Transparency helps in avoding the &#8220;DD&#8221; part of TDD, but even in OO/imperative designs, I&#8217;d rather substitute thinking for  TDD. I&#8217;ve had to fix too many code bases &#8220;designed&#8221; through TDD.</p>
<p> Wonder of wonders, a lot of people do good design by thinking (deeply) about the issue at hand without resorting to crutches like TDD. Rich Hickey is a great example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Berger</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-287</link>
		<dc:creator><![CDATA[Robert Berger]]></dc:creator>
		<pubDate>Tue, 04 Aug 2009 17:14:47 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-287</guid>
		<description><![CDATA[It would be nice if there was a way to capture the interactive tests and then easily edit them into unit tests for later regression and continuous integration testing.

In any case you&#039;ll still need a good test suite for said regression and continuous integration tests so we can still make changes over time without fear of breaking things.]]></description>
		<content:encoded><![CDATA[<p>It would be nice if there was a way to capture the interactive tests and then easily edit them into unit tests for later regression and continuous integration testing.</p>
<p>In any case you&#8217;ll still need a good test suite for said regression and continuous integration tests so we can still make changes over time without fear of breaking things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent Murphy</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-286</link>
		<dc:creator><![CDATA[Vincent Murphy]]></dc:creator>
		<pubDate>Tue, 04 Aug 2009 13:11:50 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-286</guid>
		<description><![CDATA[That&#039;s very interesting. I think a lot of newcomers, both to Clojure and the REPL, will find that useful.]]></description>
		<content:encoded><![CDATA[<p>That&#8217;s very interesting. I think a lot of newcomers, both to Clojure and the REPL, will find that useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timothy Pratley</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-285</link>
		<dc:creator><![CDATA[Timothy Pratley]]></dc:creator>
		<pubDate>Tue, 04 Aug 2009 08:05:32 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-285</guid>
		<description><![CDATA[To comment on testing specifically, I have to agree that Clojure has the allure of &#039;it just works&#039; to the point I don&#039;t like to think about testing. What I found though was that interactively I do a fair bit of testing and diagnostics (never get things right first time) which were being lost. Saving those sanity checks can be really handy later down the line.

I like to think that a minimal amount of good tests is ideal for both developing and verifying. So to me the important thing to me is, does it show how to use the function or does it show a case that needs to be handled. If I write some code to achieve something I will at least have run it in some context at some time; I want to capture that. If I find a bug, I would prefer to keep that information rather than discard it.

My work-flow to that end is roughly like this:
1) open a file and write some high level wishful thinking declarations
2) start writing some functions to support it
2.5) copy the function definitions to REPL as I create them
3) open another file and write some basic tests to check the function works
3.5) copy these to the REPL
4) iterate between the two buffers building the tests up to an example and the program toward an end goal. These eventually become similar activities and I know I&#039;m done.
5) wrap the secondary file up in deftest
Now when I come back in a month, I can just run my tests and be happy! I guess the point of my comment is simply that saving your REPL buffers can provide some value with little effort.

That&#039;s just what works for me at present, and I&#039;m happy to be educated to better approaches.]]></description>
		<content:encoded><![CDATA[<p>To comment on testing specifically, I have to agree that Clojure has the allure of &#8216;it just works&#8217; to the point I don&#8217;t like to think about testing. What I found though was that interactively I do a fair bit of testing and diagnostics (never get things right first time) which were being lost. Saving those sanity checks can be really handy later down the line.</p>
<p>I like to think that a minimal amount of good tests is ideal for both developing and verifying. So to me the important thing to me is, does it show how to use the function or does it show a case that needs to be handled. If I write some code to achieve something I will at least have run it in some context at some time; I want to capture that. If I find a bug, I would prefer to keep that information rather than discard it.</p>
<p>My work-flow to that end is roughly like this:<br />
1) open a file and write some high level wishful thinking declarations<br />
2) start writing some functions to support it<br />
2.5) copy the function definitions to REPL as I create them<br />
3) open another file and write some basic tests to check the function works<br />
3.5) copy these to the REPL<br />
4) iterate between the two buffers building the tests up to an example and the program toward an end goal. These eventually become similar activities and I know I&#8217;m done.<br />
5) wrap the secondary file up in deftest<br />
Now when I come back in a month, I can just run my tests and be happy! I guess the point of my comment is simply that saving your REPL buffers can provide some value with little effort.</p>
<p>That&#8217;s just what works for me at present, and I&#8217;m happy to be educated to better approaches.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timothy Pratley</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-284</link>
		<dc:creator><![CDATA[Timothy Pratley]]></dc:creator>
		<pubDate>Tue, 04 Aug 2009 07:18:48 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-284</guid>
		<description><![CDATA[; Personally I find it simpler to think about building the map up:
; assuming a pseudo timestamp where 25 means day 2, hour 5

(defn day [timestamp]
  (quot timestamp 10))

(defn day-table [timestamps]
  (reduce #(assoc %1 (day %2) %2)
    {}
    (sort &gt; timestamps)))

(day-table [10 15 13 21 24 25 36 33])

user=&gt; (day-table [10 15 13 21 24 25 36 33])
{1 10, 2 21, 3 33}]]></description>
		<content:encoded><![CDATA[<p>; Personally I find it simpler to think about building the map up:<br />
; assuming a pseudo timestamp where 25 means day 2, hour 5</p>
<p>(defn day [timestamp]<br />
  (quot timestamp 10))</p>
<p>(defn day-table [timestamps]<br />
  (reduce #(assoc %1 (day %2) %2)<br />
    {}<br />
    (sort &gt; timestamps)))</p>
<p>(day-table [10 15 13 21 24 25 36 33])</p>
<p>user=&gt; (day-table [10 15 13 21 24 25 36 33])<br />
{1 10, 2 21, 3 33}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Holger Schauer</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-283</link>
		<dc:creator><![CDATA[Holger Schauer]]></dc:creator>
		<pubDate>Tue, 04 Aug 2009 07:03:53 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-283</guid>
		<description><![CDATA[I&#039;m coming from exactly the opposite direction. I&#039;ve been using Common Lisp for several years, using the REPL as one of my main development aids, using ilisp first and slime since it was the next hot way to go. So, for me it was and is naturally to employ the interactive shell that Python and Ruby provide to do what I&#039;ve been doing with Lisp. I actually started writing unit tests in Ruby, out of the reason that I wanted *others* to be able to use them as a means of documentation and validating that their changes don&#039;t break anything.

The point I want to make is that there is no conflict between using the REPL and unit tests, quite to the contrary. You can easily write small functions for testing your interactively developed code using the REPL, but once you have your functions working you can just as easily drop them into your code base as unit tests. That&#039;s a huge benefit of interactive development that you just don&#039;t have with those edit-compile-debug languages.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m coming from exactly the opposite direction. I&#8217;ve been using Common Lisp for several years, using the REPL as one of my main development aids, using ilisp first and slime since it was the next hot way to go. So, for me it was and is naturally to employ the interactive shell that Python and Ruby provide to do what I&#8217;ve been doing with Lisp. I actually started writing unit tests in Ruby, out of the reason that I wanted *others* to be able to use them as a means of documentation and validating that their changes don&#8217;t break anything.</p>
<p>The point I want to make is that there is no conflict between using the REPL and unit tests, quite to the contrary. You can easily write small functions for testing your interactively developed code using the REPL, but once you have your functions working you can just as easily drop them into your code base as unit tests. That&#8217;s a huge benefit of interactive development that you just don&#8217;t have with those edit-compile-debug languages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shantanu Kumar</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-280</link>
		<dc:creator><![CDATA[Shantanu Kumar]]></dc:creator>
		<pubDate>Mon, 03 Aug 2009 18:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-280</guid>
		<description><![CDATA[I have been learning Clojure for a brief while now - I have similar experience as yours. I hardly tend to write unit tests anymore with Clojure, though I would make it a point to write functional, integration and acceptance tests.]]></description>
		<content:encoded><![CDATA[<p>I have been learning Clojure for a brief while now &#8211; I have similar experience as yours. I hardly tend to write unit tests anymore with Clojure, though I would make it a point to write functional, integration and acceptance tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-279</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Mon, 03 Aug 2009 18:10:29 +0000</pubDate>
		<guid isPermaLink="false">http://sexp.wordpress.com/2009/07/28/clojure-the-repl-and-test-driven-development/#comment-279</guid>
		<description><![CDATA[I&#039;ve had a similar experience coding in Clojure. In a nicely refactored, functional codebase, I&#039;m finding very few bugs with my unit tests. But I still love having the safety net of (run-tests &#039;my-pkg) before I check in. And the tests also serve as good documentation.

Also, I also love the convenience of using partial maps during unit testing (if your function-under-test only relies on fields x and y but not z of a map, you can pass just {:x 1 :y 2} to your function).]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve had a similar experience coding in Clojure. In a nicely refactored, functional codebase, I&#8217;m finding very few bugs with my unit tests. But I still love having the safety net of (run-tests &#8216;my-pkg) before I check in. And the tests also serve as good documentation.</p>
<p>Also, I also love the convenience of using partial maps during unit testing (if your function-under-test only relies on fields x and y but not z of a map, you can pass just {:x 1 :y 2} to your function).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

