<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>@Lathi.net: Fun with Test Driven Development</title>
    <link>http://blog.lathi.net/articles/2005/09/29/fun-with-test-driven-development</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>On Life, Fatherhood, Christianity, and Computers</description>
    <item>
      <title>Fun with Test Driven Development</title>
      <description>&lt;p&gt;My partner and I are trying to implement the state changes of two people initiating a meeting and negotiating the time.  Thanks to &lt;acronym title="Test Driven Development"&gt;TDD&lt;/acronym&gt; we worked through it!&lt;/p&gt;


	&lt;p&gt;For a while we sat there talking about &amp;#8220;what if&amp;#8221;, &amp;#8220;and then&amp;#8221;, &amp;#8220;but what about&amp;#8221; trying to get our minds around the whole process.  We had tried coding a couple of times only to whack half-baked ideas.
Finally I came to my senses, &amp;#8220;Even if we don&amp;#8217;t understand the whole process, we know what this simple case should look like.&amp;#8221;  I wrote a five line functional test, and went and hard-coded the controller to make it pass.  Success!  We made something work!&lt;/p&gt;


	&lt;p&gt;So Dave says, &amp;#8220;OK, if that&amp;#8217;s the way that should work, this case should look just like this,&amp;#8221; and codes another test.  We then go and hard-code an &lt;code&gt;elsif&lt;/code&gt; clause for that test.  Four tests later and some refactoring we had our logic working the way it should.&lt;/p&gt;


	&lt;p&gt;A couple things we experienced.  First, we didn&amp;#8217;t really know what to do but was able to code an ultra simple test.  That was enough to get us moving in the right direction.  Second, we didn&amp;#8217;t have to code the final, elegant solution.  We just hacked together something that would work for the simple test we had.  It wasn&amp;#8217;t until we had done that a couple times that we could effectively &amp;#8220;triangulate&amp;#8221; what the elegant solution should be.&lt;/p&gt;</description>
      <pubDate>Thu, 29 Sep 2005 13:31:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:7af466c8fcf2847fe80764c15a23e453</guid>
      <author>Doug</author>
      <link>http://blog.lathi.net/articles/2005/09/29/fun-with-test-driven-development</link>
      <category>Programming</category>
      <category>Test Driven Development</category>
      <category>Ruby on Rails</category>
    </item>
  </channel>
</rss>

