What’s the difference between Unit Testing and TDD? Cutting Down on Debugging Time
One of the obvious useful goal of TDD is getting rid of time wasted on debugging.
So here I am, writing codes and creating unit test afterwards, hoping it would go green straight away (ref: red-green refactoring). My heart is pounding …and the verdict is .. RED. Darn, now I’m forced to debug my code to see what I’ve done wrong in my unit test.
What have I done wrong?
Writing the unit test after the code, forced me to write deal with the complexity of the final implementation straight away. Hence when things becomes complicated, I still feel the urge to spin up the debugger.
Writing the test first avoids this issue as we are constantly and incrementally dealing with codes that is of relatively low complexity.
About this entry
You’re currently reading “What’s the difference between Unit Testing and TDD? Cutting Down on Debugging Time,” an entry on Ronald Widha
- Published:
- 01.07.09 / 2pm
- Category:
- Articles

View Comments
Jump to comment form | comments rss [?] | trackback uri [?]