<?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"
	>
<channel>
	<title>Comments on: My Great Secret to Writing Unit Tests</title>
	<atom:link href="http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/</link>
	<description>Robert Fischer and Brian Hurt on Punditry, Programming Languages, and Other Religious Issues</description>
	<pubDate>Thu, 20 Nov 2008 13:01:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Rytmis</title>
		<link>http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/#comment-31854</link>
		<dc:creator>Rytmis</dc:creator>
		<pubDate>Tue, 27 Nov 2007 06:24:35 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/#comment-31854</guid>
		<description>There seems to be an important difference in writing code and writing tests -- I, too, can write code pretty much without hesitating for a second -- I'm not saying it's going to be good code, but the block usually just isn't there --  but tests take some more thinking. Maybe it's because when you're writing a test, you're operating on a different level -- the what instead of the how. 

For me, coding without the unit tests is kind of like thinking out loud. It's relatively easy to do, but more often than not, it doesn't make sense to anyone else. :)</description>
		<content:encoded><![CDATA[<p>There seems to be an important difference in writing code and writing tests &#8212; I, too, can write code pretty much without hesitating for a second &#8212; I&#8217;m not saying it&#8217;s going to be good code, but the block usually just isn&#8217;t there &#8212;  but tests take some more thinking. Maybe it&#8217;s because when you&#8217;re writing a test, you&#8217;re operating on a different level &#8212; the what instead of the how. </p>
<p>For me, coding without the unit tests is kind of like thinking out loud. It&#8217;s relatively easy to do, but more often than not, it doesn&#8217;t make sense to anyone else. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Fischer</title>
		<link>http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/#comment-31851</link>
		<dc:creator>Robert Fischer</dc:creator>
		<pubDate>Mon, 26 Nov 2007 21:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/#comment-31851</guid>
		<description>"Hamlet D'Arcy" and "Rytmis"?  This blog may not be the most popular, but we've definitely got the coolest names for our commentators.  :D

@Hamlet

That's one of my favorites, too.  Although you should probably check out &lt;a href="http://commons.apache.org/lang/api/org/apache/commons/lang/NullArgumentException.html" target="v" rel="nofollow"&gt;NullArgumentException&lt;/a&gt; if you're in the habit of writing stuff like that.

@Rytmis

Writer's block is a good comparison.  Although it's kinda funny -- even though I'll get hung up on unit tests, I rarely (if ever) have trouble setting in to write a class/module/whatever.  The only language I have trouble doing that in is OCaml, and I think that's because OCaml's type system punishes you if you start coding before you really grok what it is you're supposed to be describing.</description>
		<content:encoded><![CDATA[<p>&#8220;Hamlet D&#8217;Arcy&#8221; and &#8220;Rytmis&#8221;?  This blog may not be the most popular, but we&#8217;ve definitely got the coolest names for our commentators.  :D</p>
<p>@Hamlet</p>
<p>That&#8217;s one of my favorites, too.  Although you should probably check out <a href="http://commons.apache.org/lang/api/org/apache/commons/lang/NullArgumentException.html" target="v" rel="nofollow">NullArgumentException</a> if you&#8217;re in the habit of writing stuff like that.</p>
<p>@Rytmis</p>
<p>Writer&#8217;s block is a good comparison.  Although it&#8217;s kinda funny &#8212; even though I&#8217;ll get hung up on unit tests, I rarely (if ever) have trouble setting in to write a class/module/whatever.  The only language I have trouble doing that in is OCaml, and I think that&#8217;s because OCaml&#8217;s type system punishes you if you start coding before you really grok what it is you&#8217;re supposed to be describing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hamlet D'Arcy</title>
		<link>http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/#comment-31849</link>
		<dc:creator>Hamlet D'Arcy</dc:creator>
		<pubDate>Mon, 26 Nov 2007 20:21:59 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/#comment-31849</guid>
		<description>I do the same thing by testing the constructor argument contract for Null values in parameters. 

In JUnit/Groovy syntax: 

public void test_constructor_arg_contract() {
  shouldFail(IllegalArgumentException) {
    new MyObject(null)
  }  
}

From there it is easy to write a 2nd test the verifies the constructor's success path.</description>
		<content:encoded><![CDATA[<p>I do the same thing by testing the constructor argument contract for Null values in parameters. </p>
<p>In JUnit/Groovy syntax: </p>
<p>public void test_constructor_arg_contract() {<br />
  shouldFail(IllegalArgumentException) {<br />
    new MyObject(null)<br />
  }<br />
}</p>
<p>From there it is easy to write a 2nd test the verifies the constructor&#8217;s success path.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rytmis</title>
		<link>http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/#comment-31848</link>
		<dc:creator>Rytmis</dc:creator>
		<pubDate>Mon, 26 Nov 2007 19:56:16 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/2007/11/26/my-great-secret-to-writing-unit-tests/#comment-31848</guid>
		<description>It's something akin to a writer's block -- I have the same thing when I'm supposed to work on any text. Typing down anything, even the most dull, boring and obvious first phrase will usually open the floodgates. Then, like the trivial assertion, the first phrase can be deleted when there's good text to replace it.</description>
		<content:encoded><![CDATA[<p>It&#8217;s something akin to a writer&#8217;s block &#8212; I have the same thing when I&#8217;m supposed to work on any text. Typing down anything, even the most dull, boring and obvious first phrase will usually open the floodgates. Then, like the trivial assertion, the first phrase can be deleted when there&#8217;s good text to replace it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
