« Overusing ArrayLists | Main | What Microsoft keeps teaching us – what not to ship? »
April 07, 2005
Kent Beck violates rules of TDD? Does he really?
Every morning, before leaving for work, I skim through discussions on yahoogroups. Today morning, this posting from Kent Beck on the ExtremeProgramming group gave me a sweet jolt:
<KentBeck>
I recently coded without a test. I tried for several hours to get a test written and couldn't. I still wanted to make progress on the feature. I went ahead and implemented the feature (it took a minute) and manually verified its behavior. I wasn't (am not) as comfortable as I would have been with the tests, but I'm satisfied with my decision.
</Kent Beck>
When I read this post for the first time, I concluded that Kent Beck broke his own rule. Kent wrote code without tests? In fact, someone immediately questioned Kent about the impact of this posting on the community.
I read the posting again and it was then that I found this posting very inspiring.
Kent tried for several hours, to write one test before giving up. When he gave up, he implemented the feature in a minute. I am sure, while struggling to write one test for several hours, he was fully aware that the implementation was trivial. However, he persisted for several hours before giving up.
There are times when it is difficult to write tests; for e.g. on my current project, the team is developing a multi-threaded, multi-processor application. It has been challenging to do TDD on some stories and I have been challenged a few times as the efforts involved in writing tests for some features are very involved.
It is a delicate balance to achieve: efforts involved in writing a test vs. making progress. If I was in Kent’s situation, I would have given up quiet early. Now, I have a higher standard before giving up on writing tests.
Posted by gunjan at April 7, 2005 11:09 AM
Trackback Pings
TrackBack URL for this entry:
http://www.gunjandoshi.com/cgi-bin/mt-tb.cgi/3