What is TDD?

Published 02 June 04 10:41 AM

It took me a while to figure this stuff out.  Maybe most people already know this, in which case I’m the last one to the party.

 

 

Unit Testing is not the only way to do Test-Driven Development.  All you need is 1) don't write any code without a failing test, and 2) remove duplication.  Using MSTest or automation model or whatever is fine, as long as you follow these two rules.

 

Test-Driven Development is not the only reason to do Unit Testing.  For example, if my team's primary deliverable is source code, then I expect my QA to test my classes one at a time.

 

Test-Driven Development is primarily about Development, not about Testing.  It's a dev activity, not a QA activity.  It's a technique for writing code, not for verifying code. 

 

TDD doesn't replace QA.  There is plenty of testing that falls outside of the scope of the development activity.  TDD is likely to reduce the amount of testing that has to be done, by removing the most dull & mindless aspects of testing.  This makes QA's job much more interesting, I expect.

 

Unit Testing isn't the only kind of testing you need to do.  I guess this is the corollary.  Stress, usability, performance, etc. are outside of the realm of UT.

 

 

QA needs to run the unit tests every night, on a variety of hardware, OS, and language configurations.  They need to gather the results and tally them up in Excel charts.  They need to do this with stress and performance, too.  QA needs to know that the unit tests have near 100% code coverage.  QA needs to know they're testing everything they think users will do.

 

Dev needs to run unit tests every 45 seconds as they progress through a user story.  Devs need to write the tests that give them confidence in their work.  Confidence to refactor.  Confidence to share code ownership.

 

 

Make sense?

Comments

# Tim Weaver said on June 2, 2004 10:54 AM:
The question I have is how does the new ability to create unit test from code change the future of TDD with MS tools---re: " All you need is 1) don't write any code without a failing test, and "
# jaybaz [MS] said on June 2, 2004 11:33 AM:
Maybe generating unit tests from existing code is a good activity for you. If you're retrofitting unit tests onto existing code, for example.

It may be a precursor to doing TDD, or it may be a testing activity that helps you gain confidence. I can see when it might be extremely valuable.

But, it's not TDD. It's not a way of writing code.
# Thomas Eyde said on June 2, 2004 3:46 PM:
A nice side effect of TDD is that the test is your first client. The production client is the second. So TDD increase reusability.
# !!~ 鼭 α׷ ̾߱ said on June 7, 2004 2:54 AM:
T : What is TDD? by jaybaz [MS]

ó TDD ? ?? TDD ? ? ? ? ?? ...

? ?...

?T TDD ? ? ??.

# Jonathan de Halleux said on June 21, 2004 3:19 AM:
Right to the point. :)
# public MattBerther : ISerializable said on June 23, 2004 2:42 PM:
One of my favorite bloggers as of late is Jay Bazuzi (rss), who works on the Visual C# IDE team at Microsoft. Give him a read; he's got some posts that are sure to melt your brain, such as "no...
# Kevin Dente's RantLog said on July 1, 2004 5:13 PM:
# jaybaz [MS] WebLog said on July 1, 2004 8:49 PM:
# Min Kwan Park's bLog said on July 19, 2004 12:16 PM:
New Comments to this post are disabled

This Blog

Syndication

Page view tracker