Tuesday, January 04, 2005

Is TDD an engineering way?

Recently I had a discussion with a couple of my colleagues here at TW about TDD. One of them was of the view that TDD is not an engineering way of coding, because it takes away the element of thinking from you when you do TDD and that the designs unfold before you. That itself partly being a credit to TDD, I tend to disagree that TDD is not an engineering way. In engineering, lots of importance is given to specification, and TDD is a way of writing the specs before writing the code, a perfect engineering way. You write tests before you write the code that is tested. Tim Bray seems to be of the same opinion here.

And as far as the element of thinking goes, I disagree again. Though TDD is simple, it takes a lot of thinking to recognize the emerging patterns and code smells. It is not easy to notice the designs unfold before you, especially for a beginner. Also, code smells if it takes you time to write a simple test. It is high time you start refactoring before going ahead. You need to realize all these and much more as you do TDD. It is simple, not easy.


Post a Comment

<< Home