Jaa


What is TDD?

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

  • Anonymous
    June 02, 2004
    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 "
  • Anonymous
    June 02, 2004
    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.
  • Anonymous
    June 02, 2004
    A nice side effect of TDD is that the test is your first client. The production client is the second. So TDD increase reusability.
  • Anonymous
    June 06, 2004
    T : What is TDD? by jaybaz [MS]

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

    ? ?...

    ?T TDD ? ? ??.

  • Anonymous
    June 20, 2004
    Right to the point. :)
  • Anonymous
    June 23, 2004
    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...