[TDD] TDD is a steering process…
Friday, April 13th, 2012Page 42, Test-Driven Development by Example written by Kent Beck
Image source: http://net.tutsplus.com/tutorials/php/the-newbies-guide-to-test-driven-development/
When we decide how much we need to do test during TDD, we don't need to worry and spend a lot of times to decide the coverage and steps in detail. Let's see the Kent Beck's advice:
This is the kind of tuning you will be doing constantly with TDD. Are the teeny-tiny steps feeling restrictive? Take bigger steps. Are you feeling a little unsure? Take smaller steps. TDD is a steering process - a little this way, a little that way. There is no right step size, now and forever.
- Page 42
Image source: http://www.raynauds.org/index.php/2011/04/heated-steering-wheel-cover-news/
Page 46, Test-Driven Development by Example written by Kent Beck
Moreover, we need to abandon our habit even though we are excellent software engineers. Don't try to do everything by ourselves! Pass our works to computers or tools. That's why we have developed the computers and tools we are using.
In teaching TDD, I see this situation all the time - excellent software engineers spending 5 to 10 minutes reasoning about a question that the computer could answer in 15 seconds.
- Page 46
Page 47, Test-Driven Development by Example written by Kent Beck
I know that I show the message - "All code is guilty until proven innocent" above. However there is an exceptional case, as always. In page 47, Kent Beck is trying to do implement "toString()" method without a test! If there are understandable reasons, then you need to accept it.
Whoa! Code without a test? Can you do that? We could certainly have written a test for toString() before we code it. However,
-. We are about to see the results on the screen.
-. Because toString() is used only for debug output, the risk of it failing is low.
-. We already have a red bar, and we'd prefer not to write a test when we have a red bar.
Exception noted.- Page 47
Do not forget the principle and purpose! Our purpose is developing software, not the TDD itself!
Happy TDD!


