Jean-Paul S. Boodhoo

Sponsors

The Lounge

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
TDD is like snowboarding (or learning any new skill)

I just received the following email that I thought I would share and answer publicly:

“I’m not using this methodology (TDD) because my principal question remains unanswered. I know that with TDD you should release less bugs, but what about the time needed to develop with that methodology ?

 

I would like to know if the time to develop an enterprise solution is faster, equal, or longer with TDD.

 

I hope you will be able to answer me because i’m very intrigued and interested by TDD and DDD.”

 

The first and most important point that I would like to draw attention to  is the misconception that TDD is a tool to ensure that you should release less bugs. Although one side effect of TDD is the fact that you may well end up with a smaller bug count that is not the driving factor behind the adoption and practice of TDD. The driving factor behind TDD is that of driving out the design of components in your system one test at a time.

 

With respects to the question:

 

“I would like to know if the time to develop an enterprise solution is faster, equal, or longer with TDD.”

 

When you first make a decision to head out onto the ski hill and take a shot at snowboarding you head out with a dream in your head of being able to carve it up within minutes and do tricks that would make SSX Tricky look lame. The reality of the situation quickly kicks in once you have fell for your first couple of times and you realize that it is going to take a bit of time before you become proficient enough just to traverse the hill without any glitz and glamour. If you are wise, you will take the time to get instruction from a qualified teacher, who can help you establish good footing and technique from day 1. Building upon this base of solid instruction will ensure that you able to grow as a snowboarder effectively over the next couple of months, and potentially avoid picking up any bad habits you may have formed had you tried to pick up the sport yourself without any instruction.

 

Like snowboarding (or any new skill you wish to acquire), in the beginning a lot of learning is going to be taking place. For the majority of people who venture into TDD waters, they realize that there are potential big holes in their skillset that may cause them pain in this new world. Assuming that those holes are not there, you will still have to deal with the fact that for the first little while you will be training your brain to tackle and solve programming problems in a way that it is not accustomed to. This is actually one of the biggest hurdles people have to jump when getting into TDD. The development of a new style of coding that forces you to think about a small win and code the API as if it is already there. A good way to start into TDD is to start with state based testing. Once you have got a good handle on state based testing you may mix it up with interaction based testing also.

 

The fact of the matter is, when you start TDD you may very well end up finding yourself moving ahead at a slower pace than normal, this is predominantly because you will be working out of a comfort zone that does not yet feel natural. When you experience your AHA moment with TDD, it will be shortly after that when you realize that writing the test has now become a natural extension of how you work, you won’t need to account for the fact that you are using TDD to build a project, as it will be melded into the way you function as a developer.

 

Having witnessed two teams (one agile, one non agile) with developers of the same caliber being asked to deliver functionality on a project. The team that practiced TDD was able to meet the needs and changing requirements in a way that completely surpassed the team that was coding without TDD. I have seen it work on my own projects countless times, projects ranging is size from the small to the large enterprise level. I personally would not be trying to teach people the benefits of TDD if I did not feel it was a justifiable learning to undertake. Speaking for myself, it has completely transformed the way I look at solving problems in the programming realm.

 

Much like many developers have acquired traits and behaviours with respects to their coding style and how they solve problems, TDD becomes another “natural” trait that becomes part of what you do to solve problems. The first thing you will do when faced with a problem is write a failing test to capture the requirement that you want met.

 

Ultimately, people have to make a decision to take a walk down TDD avenue and stick with it long enough for it to become something that feels natural. If you don’t give it a good shot, you could walk away not realizing the benefits that TDD can bring to your development arsenal.

 

For those of you who are looking at TDD as a serious option but have not yet picked it up, this may be a good season to hit the hill!!

 


Posted Fri, Nov 2 2007 3:31 PM by bitwisejp
Filed under: ,

[Advertisement]

Comments

Christopher Steen wrote Link Listing - November 2, 2007
on Fri, Nov 2 2007 11:04 PM

ASP.NET 3 hot uses for HttpContext.Current.Items “They” won’t tell you about. [Via: Duncan ] Bipin Joshi's...

Christopher Steen wrote Link Listing - November 2, 2007
on Fri, Nov 2 2007 11:04 PM

Link Listing - November 2, 2007

The Other Steve wrote re: TDD is like snowboarding (or learning any new skill)
on Sat, Nov 3 2007 1:06 PM

I've noticed a pattern.

People like to spend a lot of time writing about TDD and how dumb people are for not doing it but nobody seems to like to write about how to actually do TDD, so that more people are doing it.

Just curious.

Tales from the SharpSide wrote Links from the Sharpside [11.03.07]
on Sat, Nov 3 2007 6:20 PM

Links from the Sharpside [11.03.07]

cmyers wrote re: TDD is like snowboarding (or learning any new skill)
on Sat, Nov 3 2007 6:23 PM

@The Other Steve:  Are you serious? Ever heard of "google.com"? :)  Seriously, there's tons of links, books, articles, etc on this. Many of the best ones are on THIS SITE!

I have a link-dump here that I just did like 2 days ago:

www.chadmyers.com/.../starting-a-new-set-of-projects-what-to-do.aspx

Here's a decent Google search (I assume you're doing C#, right? There are some VB.NET ones out there too, the principles are the same though regardless of language)

www.google.com/search

Here's another basic TDD query (with some unrelated TTY and Time division multiplex stuff removed):

www.google.com/search

Craig Bowes wrote re: TDD is like snowboarding (or learning any new skill)
on Sat, Nov 3 2007 9:35 PM

Jean,

You didn't fully answer one important question: "Does TDD take longer?"

Certainly learning a new technology skill will cause you to move slower.  Learning asp.net 2.0 (coming from 1.1) caused me and my team some time to pick up the new controls, providers and other API elements.  But once we got past that we are just as productive or more so now that we have 2.0 under our belts.

But the question remains:  AFTER you do learn TDD and it becomes that "natural extension" would you say you are slower, faster or just the same?

Sorry, had to play devils advocate.

-Craig

cmyers wrote re: TDD is like snowboarding (or learning any new skill)
on Sat, Nov 3 2007 10:18 PM

@Craig: Watch one of his screencasts. I don't think *ANYTHING* could slow JP down. Maybe if you tied a hand behind his back, but I'd have to see it to believe it.

Stephen Smith wrote re: TDD is like snowboarding (or learning any new skill)
on Mon, Nov 5 2007 1:21 AM

The alternative to writing testable code is to write detestable code (in both senses of the word)!

Dan Martin wrote re: TDD is like snowboarding (or learning any new skill)
on Wed, Nov 7 2007 8:28 AM

Stephen,

Heh, that's one quote I'll be sure to remember.

Snowboard News Wire » TDD is like snowboarding (or learning any new skill) wrote Snowboard News Wire » TDD is like snowboarding (or learning any new skill)
on Wed, Nov 14 2007 3:05 AM

Pingback from  Snowboard News Wire » TDD is like snowboarding (or learning any new skill)

ThemePassion - Best stuff about design! » TDD is like snowboarding (or learning any new skill) wrote ThemePassion - Best stuff about design! » TDD is like snowboarding (or learning any new skill)
on Fri, Nov 16 2007 8:08 PM

Pingback from  ThemePassion - Best stuff about design! » TDD is like snowboarding (or learning any new skill)

snowboarding » Blog Archive » TDD is like snowboarding (or learning any new skill) wrote snowboarding » Blog Archive » TDD is like snowboarding (or learning any new skill)
on Sat, Nov 24 2007 1:23 PM

Pingback from  snowboarding  » Blog Archive   » TDD is like snowboarding (or learning any new skill)

Snowboarding » Blog Archives » Something tells me that you're too scared. wrote Snowboarding » Blog Archives » Something tells me that you're too scared.
on Sun, Dec 2 2007 12:48 PM

Pingback from  Snowboarding  » Blog Archives   » Something tells me that you're too scared.

Snowboarding » Blog Archive » Mick Fanning Breaks Wrist Snowboarding wrote Snowboarding » Blog Archive » Mick Fanning Breaks Wrist Snowboarding
on Thu, Jan 17 2008 8:42 AM

Pingback from  Snowboarding  » Blog Archive   » Mick Fanning Breaks Wrist Snowboarding