More TDDs Pros & Cons
Pros:
* Just had my first "TDD caught a stupid mistake" experience!
* Easier to leave your code and come back later - assuming you got the test in place. Running the test suite reminds you where you are.
Cons:
* I was getting kind of sloppy, because I knew I had the TDD safety net...

Your last comment here reminds me why I drifted away from this practice. I was getting sloppy too. I raised this question a while ago on the XP newsgroup. I got a reply from Kent suggesting that when you start thinking and working at a higher level of abstraction, the details of working at the lower level start to get fuzzy. This was encouraging (in a way) since the practice was obviously having an effect.
But I decided that in my line of work (at least for the present) I still need that low level experience. I almost always work in C / C++ and the odd bit of assembler or VU whereas TDD evolved in high level, dynamically typed, languages like Smalltalk. I could still work test first in lower level languages. But when I do, the tests constrain the code in ways are not a problem in higher level languages.
Working "trial and error" I have less confidence in my code up front, but my confidence grows with every test and review. With test first, my confidence is initially very high (after all, it passes all these tests) but that confidence degrades as the bugs start to show up and changes force the code to burst out of its test scaffolding. I feel more confident starting low and climbing than starting high and falling.
Posted by: Paul Sinnett | June 16, 2006 at 03:48 PM
More Pros:
- I'm sure your code is more robust, decoupled and self commented with TDD.
- Now, you have a suite of "samples ready to use" with your tests
More Cons:
- Tons of new code to write and maintain.
- Who will test your tests?
Cheers!
Posted by: JM | June 17, 2006 at 03:38 AM