<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/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>Raymond Law: Tag test</title>
    <link>http://blog.rayvinly.com/articles/tag/test</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Test/Behavior-driven development</title>
      <description>&lt;p&gt;I have done testing using the Rails testing framework (test-driven development) and also am looking at RSpec (behavior-driven development), so I asked &lt;a href="http://chadfowler.com/"&gt;Chad Fowler&lt;/a&gt; about his view on the two approaches.  He told me the inventor of behavior-driven development said to him:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8220;You don&amp;#8217;t need to do behavior-driven development because you already know behavior-driven development.&amp;#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;&lt;em&gt;Translation:&lt;/em&gt; TDD and &lt;span class="caps"&gt;BDD&lt;/span&gt; are basically the same thing.  If you really understand what &lt;span class="caps"&gt;TDD&lt;/span&gt; is about, you are already doing &lt;span class="caps"&gt;BDD&lt;/span&gt;, regardless which testing framework you are using.&lt;/p&gt;


	&lt;p&gt;I also asked him how long it takes to do &lt;span class="caps"&gt;TDD&lt;/span&gt;/BDD versus w/o any testing.  He answer:&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8220;Negative twenty percent.&amp;#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;A lot of existing projects don&amp;#8217;t follow &lt;span class="caps"&gt;TDD&lt;/span&gt;/BDD and it is difficult/impossible to get involved in the middle and do that because development time is expected and it is less motivating when you are the only developer who writes tests.&lt;/p&gt;


	&lt;p&gt;Therfore, one thing I am determined to do from now on is that for my next Rails personal project, before I write any code, I will write a test to fail and then write code to make it pass.&lt;/p&gt;


	&lt;p&gt;Initially, it may take more time and getting used to, but hopefully it will cut down on debugging time and redesigning later on in the development process.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve heard about &lt;span class="caps"&gt;TDD&lt;/span&gt;/BDD for quite some time and have also tried for some personal projects.  But I think I will really force myself to strictly follow this paradigm, so I can get a real feel of how well it works.&lt;/p&gt;</description>
      <pubDate>Tue, 25 Mar 2008 22:50:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:8b31df74-f4ef-4f2d-a9e7-39f5bff11aae</guid>
      <author>Raymond Law</author>
      <link>http://blog.rayvinly.com/articles/2008/03/25/test-behavior-driven-development</link>
      <category>Random</category>
      <category>Ruby on Rails</category>
      <category>Web 2.0</category>
      <category>ruby</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>test</category>
      <category>tdd</category>
      <category>bdd</category>
      <trackback:ping>http://blog.rayvinly.com/articles/trackback/57</trackback:ping>
    </item>
  </channel>
</rss>
