What is TDD?
TDD, also know as Test Driven Development.Yesterday at DavDays 2005 in The Hague I attended a session about test driven development given by Erno De Weerd form Info Support And i must say it was a real eye opener. I cannot explain the whole thing here but I will try to give some highlights and key points.
Test driven development is so much more then just writing tests first. It is a whole methodology. It al start with creating a list with tests. You could compare this with what we now know as requirements.
After creating the list you categorize and order them.
But be sure to divide it into small pieces; do not create a test like we need a calculator. No write something like we need to be able to add numbers.
After you have order your list according to risk, ability, complexity, ect you pick the first test from the list and focus on it!
Write a test that covers what you picked. And the see it Fail. Once it fails you can start writing code to make it pass. But do only that, do not think about next steps. Focus on solving this little problem.
Then see if your test passes now.
If it does, then see if your newly written code can use refactoring. And of course Visual Studio 2005 has excellent support for doing this. (it really is a good improvement.)
Once you have refactored you can take your next item from the list and start all over again, until you have fixed all your items.
The great thing about working this way is that you have all your tests available for you and every time you change something you can see if you didn’t break any existing tests. And so reducing bugs in your final version.
Another advantage is that it is a iterative process, this means that changes in requirements (and we all know that the customer always wants changes) are easily worked into the cycle.
Some key features as I see them about TDD are:
- Innovative: It can adapt to changes easily.
- Baby steps: Divide everything it small easy to swallow pieces.
- Iterative: keep doing those small items until you are done.
- Stability: you can execute your test as much as you want and every time making sure you don’t break anything.
As you can see this methodology is a new approach. Of course Erno can explain this a lot better then I can so if you have a chance to do catch his session about this topic, don’t hesitate, you won’t regret it.
I am a newbie to this kind of development, but I’m sure going to look into this some further. Another advantage is that you can also fit small pieces of this into other methodologies (MDF,RUP,…) so you can do this in existing and ongoing projects.
For more information I would suggest TestDriven.

6 Comments:
Nice article
a lot of neat stuff is also found on MSF for Agile Software DevelopmentRegards Ben
A very good book to read on TDD is the book of James Newkirk : Test-Driven Development in Microsoft .NET .
I am glad you enjoyed the talk.
Thanks for attending!
Thank you!
[url=http://eqiandke.com/xhvv/vgrh.html]My homepage[/url] | [url=http://ddufgtiw.com/nofr/kcfz.html]Cool site[/url]
Well done!
My homepage | Please visit
Thank you!
http://eqiandke.com/xhvv/vgrh.html | http://koorbpju.com/ztyr/yloq.html
Post a Comment
<< Home