<?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>Object Mentor Blog: Not A Task, But An Approach</title>
    <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Not A Task, But An Approach</title>
      <description>&lt;p&gt;Transitions are tough. It seems that lately I&amp;#8217;ve been getting a lot of contact from frustrated people who don&amp;#8217;t really have a good handle on the &amp;#8220;drive&amp;#8221; part of Test Driven Development.  A question heard frequently is: &amp;#8220;I&amp;#8217;ve almost completed the coding, can you help me write the &lt;span class="caps"&gt;TDD&lt;/span&gt;?&amp;#8221;&lt;/p&gt;


	&lt;p&gt;It seems like Test Driven Development is taken backward, that the &lt;em&gt;developers&lt;/em&gt; are &lt;em&gt;driven&lt;/em&gt; to write &lt;em&gt;tests&lt;/em&gt;.  The practitioner winces, realizing that he again faces The Great Misunderstanding of &lt;span class="caps"&gt;TDD&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;TDD&lt;/span&gt; stands for Test-Driven Development, which is not as clear as &lt;span class="caps"&gt;TFD&lt;/span&gt; (Test-First Development). If the consultant would strive to always say the word &amp;#8220;first&amp;#8221; in association with testing, most people would more surely grasp the idea.  In fact, I&amp;#8217;ve begun an experiment in which I will not say the word &amp;#8220;test&amp;#8221; without the word &amp;#8220;first&amp;#8221; in close approximation. I&amp;#8217;ll let you know how that works out for me.&lt;/p&gt;


	&lt;p&gt;If the tests are providing nothing more than reassurance on the tail end of a coding phase, then the tests aren&amp;#8217;t driving the development.  They are like &lt;em&gt;riders&lt;/em&gt; instead of &lt;em&gt;drivers&lt;/em&gt;.  Test-Ridden Development (TRD)[1] would be a better term for such a plan. Even though it is better to have those tail-end tests than to have no automated testing, it misses the point and could not be reasonably be called &lt;span class="caps"&gt;TDD&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;An old mantra for &lt;span class="caps"&gt;TDD&lt;/span&gt; and &lt;span class="caps"&gt;BDD&lt;/span&gt; is &amp;#8220;it&amp;#8217;s not about testing&amp;#8221;. The term &lt;span class="caps"&gt;BDD&lt;/span&gt; was invented largely to get the idea of &amp;#8220;testing&amp;#8221; out of the way.  People tend to associate &amp;#8220;test&amp;#8221; as a release-preparation activity rather than an active approach to programming. &lt;span class="caps"&gt;BDD&lt;/span&gt; alleviates some of that cognitive dissonance.&lt;/p&gt;


	&lt;p&gt;In &lt;span class="caps"&gt;TDD&lt;/span&gt;, tests come first. Each unit test is written as it is needed by the programmer.  Tests are just-in-time and are active in shaping the code. Acceptance Tests likewise tend to precede programming by some short span of time.  [2]&lt;/p&gt;


Through months of repetition I have developed the mantra:
&lt;blockquote&gt;
&lt;span class="caps"&gt;TDD&lt;/span&gt; isn&amp;#8217;t a task. It is not something you do.  It is an approach.  It is how you write your programs.
&lt;/blockquote&gt;

	&lt;p&gt;I wonder if we shouldn&amp;#8217;t resurrect the term Test-First Programming or Test-First Development for simple evocative power. Admittedly there are some who would see that as a phase ordering, but maybe enough people would get the right idea.&lt;/p&gt;


	&lt;p&gt;Brett Schuchert(with some trivial aid from your humble blogger) has worked up an acronym to help socialize the basic concepts which are somehow being lost in translation to the corporate workplace.&lt;/p&gt;


	&lt;p&gt;The teaser:
    Fast, Isolated, Repeatable, Self-validating, and Timely.&lt;/p&gt;


	&lt;p&gt;As a reader of this blog, you are probably very familiar with all of the terminology and concepts behind &lt;span class="caps"&gt;TDD&lt;/span&gt;. I beg of you, socialize the idea that testing comes first and drives the shape of the code.  If we can just get this one simple idea spread into programming dens across our small spheres of influence, then we will have won a very great victory over Test-Ridden Development.&lt;/p&gt;


	&lt;p&gt;&amp;#8220;And there was much rejoicing.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;&lt;small&gt;
1 Jeff Langr will refer to this &lt;span class="caps"&gt;TRD&lt;/span&gt; concept as &amp;#8220;Test-After-Development&amp;#8221;, which he follows with a chuckle and a twinkle, &amp;#8220;which is a &lt;span class="caps"&gt;TAD&lt;/span&gt; too late.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;2 Of course, one still needs QC testing as well, however &lt;span class="caps"&gt;TDD&lt;/span&gt; is about driving development, not testing its quality post-facto.
&lt;/small&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 02 Aug 2007 22:14:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:bd848598-96fa-4e15-84e8-ccba83ab4325</guid>
      <author>Tim Ottinger</author>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach</link>
      <category>Tim's Tepid Torrent</category>
      <category>FIRST</category>
      <category>testing</category>
      <category>mentoring</category>
      <category>TDD</category>
      <category>TRD</category>
      <category>TAD</category>
      <category>Fast</category>
      <category>Isolated</category>
      <category>Repeatable</category>
      <category>Self</category>
      <category>validating</category>
      <category>Timely</category>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Susan</title>
      <description>&lt;p&gt;Im newbie here, thank you all!&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jun 2008 07:23:17 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b44fd295-813b-4b6e-8e03-7624283a7cba</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-1793</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Nathan Henkel</title>
      <description>&lt;p&gt;One problem I have with using the term &amp;#8220;Test-First Development&amp;#8221; is that I think it loses information compared to the term &amp;#8220;Test-Driven Development&amp;#8221;. The first simply suggests to me that I write tests before code (which is good), the second suggests that I write tests before code AND allow my tests to drive the design of my code, so I&amp;#8217;m doing the &amp;#8220;simplest thing&amp;#8221; that will pass my tests.&lt;/p&gt;


	&lt;p&gt;With test-first development, you might write some tests, and then write the code you &amp;#8220;know&amp;#8221; you&amp;#8217;ll need (because you&amp;#8217;re being driven by a preconceived design, or intuition, or cast bones), which happens to DO more than your tests actually verify. Now you have untested functionality. True TDD tells you to write the simplest code that will pass your tests, write new tests to demonstrate the inadequacies of that code, rewrite or add to the code to pass those tests and so on until you can&amp;#8217;t think of any more useful tests. The tests are driving your coding, so, theoretically, you won&amp;#8217;t have any untested functionality, and practically you&amp;#8217;ll have very little.&lt;/p&gt;


	&lt;p&gt;I do get the problem of making sure people understand that the tests have to come FIRST&amp;#8212;how can they drive when they&amp;#8217;re sitting in a trailer hitched to the back? On the other hand, putting them in the passenger seat or strapping them to the hood isn&amp;#8217;t quite right either. Maybe not abbreviating is the answer, or perhaps emphasis: &amp;#8220;test DRIVEN development&amp;#8221;...&lt;/p&gt;</description>
      <pubDate>Mon, 20 Aug 2007 11:40:53 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:868c0cbc-1ca6-4e27-b040-f008cd51c002</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-712</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Dean Wampler</title>
      <description>&lt;p&gt;Just a bit more about Behavior-Driven Development (BDD); Dan North coined the phrase. Here is his article &lt;a href="http://dannorth.net/introducing-bdd/" rel="nofollow"&gt;introducing BDD&lt;/a&gt;. There are now &lt;a href="http://dannorth.net/2007/06/introducing-rbehave" rel="nofollow"&gt;rbehave&lt;/a&gt; and &lt;a href="http://jbehave.org/" rel="nofollow"&gt;jbehave&lt;/a&gt; tools for driving development at the requirements/story level, while &lt;a href="http://rspec.rubyforge.org/" rel="nofollow"&gt;rspec&lt;/a&gt; is focused more on the &amp;#8220;unit&amp;#8221; level.&lt;/p&gt;</description>
      <pubDate>Wed, 08 Aug 2007 10:38:06 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:dcfa15cd-8674-485a-892e-375f2f936bff</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-594</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Tim</title>
      <description>&lt;p&gt;vabhav: certainly. You can&amp;#8217;t drive the code without working on the code.&lt;/p&gt;


	&lt;p&gt;Test-last development won&amp;#8217;t have the same effect, and rather will force you to spend a lot of time and effort writing runnable tests, rather than writing testable code.&lt;/p&gt;</description>
      <pubDate>Tue, 07 Aug 2007 09:14:14 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0c88a3d2-b4f7-4e62-9acb-8fda4829169f</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-592</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by vabhav jain</title>
      <description>&lt;p&gt;I am 100% agree but the follow the apporach you need to work on task&lt;/p&gt;</description>
      <pubDate>Tue, 07 Aug 2007 01:38:22 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:d4f43792-49ff-464a-967b-11171aae360e</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-591</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Tim</title>
      <description>&lt;p&gt;TDD helps developers understand requirements (or at least correct misunderstandings early).&lt;/p&gt;


	&lt;p&gt;I don&amp;#8217;t know why you think that they analyze all requirements before writing any code.&lt;/p&gt;


	&lt;p&gt;My experience is that one may look over the requirements (AKA &amp;#8220;Acceptance Tests&amp;#8221;) in small sets, but often doesn&amp;#8217;t do a lot of &amp;#8220;long range analysis&amp;#8221;. Frequently the developer knows quite a bit because he has participated in the planning sessions and has helped estimate the story, but sometimes the AT is enough.  Then there is the TDD three-step dance of one little test, one little change, one burst of refactoring.&lt;/p&gt;


	&lt;p&gt;As to how it changes the shape of your code, this is lightly touched upon in &lt;a href="http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions" rel="nofollow"&gt; an earlier referenced post.&lt;/a&gt;  Generally, though, you will write the code intentionally to be (unit) testable. from the very start.  That implies a lot of things.&lt;/p&gt;</description>
      <pubDate>Mon, 06 Aug 2007 19:56:46 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:0502aa52-3904-47ab-ba7f-b4c59d3d28fa</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-590</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Anand</title>
      <description>&lt;p&gt;See, as i understtod, TDD helps developer understanding requirements before coming up with code, and because they are going to write Unit test cases, they will certainly analyze each and every piece of requirement before writing a single line of code. But can you telle me, how it affectes our design, like which design pattern, and granularity of code?An example may be of more help.&lt;/p&gt;</description>
      <pubDate>Mon, 06 Aug 2007 15:53:33 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b666419a-8078-4b92-bff0-ce75291a8520</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-589</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Tim</title>
      <description>&lt;p&gt;BDD is &amp;#8220;Behavior Driven Design&amp;#8221;, and is a further development of TDD.  If you look at RSpec, you will see the current state of development of BDD.  David Chelimsky and Dave Astels seem to have the lead on this.&lt;/p&gt;</description>
      <pubDate>Mon, 06 Aug 2007 10:29:39 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e065bd04-5dff-4f9c-9179-f93736e957dd</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-587</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Bill</title>
      <description>&lt;p&gt;Ok, It&amp;#8217;s Monday and I&amp;#8217;m running a bit slow, what is BDD? Note Google wasn&amp;#8217;t much help offering up:&lt;/p&gt;


	&lt;p&gt;Behaviour-Driven Development&lt;/p&gt;


	&lt;p&gt;Business-driven Development&lt;/p&gt;


	&lt;p&gt;Backup Driven Development&lt;/p&gt;


	&lt;p&gt;to name a few.&lt;/p&gt;</description>
      <pubDate>Mon, 06 Aug 2007 09:14:51 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:b96290bc-1d65-40a1-a2b5-50a82f406047</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-586</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Jeff L.</title>
      <description>&lt;p&gt;&amp;#8220;A chuckle and a twinkle?&amp;#8221; I guess I&amp;#8217;m Santa Claus.&lt;/p&gt;</description>
      <pubDate>Sun, 05 Aug 2007 13:38:54 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:4c59b301-b7f2-4190-b52e-99738dea782c</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-584</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Tim</title>
      <description>&lt;p&gt;I think you are right.  I think I can do better.&lt;/p&gt;


	&lt;p&gt;Clearly I am trying to say in that one throwaway line that test-first will change how we make decisions about our code (which patterns we&amp;#8217;ll use or avoid, how much the code exposes state, how granular we make our functions, how much we rely directly on other objects, etc).   In short all the things from &lt;a href="http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions" rel="nofollow"&gt;my earlier posting&lt;/a&gt; and more.&lt;/p&gt;


	&lt;p&gt;But that&amp;#8217;s not what I said, and what I said can certainly seem an overstatement.  I will make revisions.&lt;/p&gt;</description>
      <pubDate>Fri, 03 Aug 2007 07:31:23 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:8018132b-b3ea-4877-80c0-e9a323037187</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-580</link>
    </item>
    <item>
      <title>"Not A Task, But An Approach" by Sadek Drobi</title>
      <description>&lt;p&gt;I agree with most of what you said, but not completely on &amp;#8221; drives the shape of the code.&amp;#8221; I guess that this is confusiong, and needs a bit of clarification&amp;#8230; see: &lt;a &gt;It is NOT a test driven design!&lt;a / rel="nofollow"&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 03 Aug 2007 01:55:30 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e59635f5-ae0c-49fa-a330-a6b68d29c43e</guid>
      <link>http://blog.objectmentor.com/articles/2007/08/02/not-a-task-but-an-approach#comment-578</link>
    </item>
  </channel>
</rss>
