Wednesday, June 08, 2005

My most recent experience with test-driven development as a design methodology has been largely positive, but one must be warned about the importance that refactoring plays within the whole process. In my exuberance, I found myself writing lots of tests, and dutifully running them everytime I performed a non-trivial (and what exactly does that mean? Perhaps we'll get to this later, gentle reader!) change. However, I also found that my program was getting somewhat ugly as far as design goes. It's not that I wasn't refactoring, but rather that my refactoring was insufficient, and that I was always re-examining code (and design) in a very limited sense. So, I ended up with locally clean modules, which combined (no surprise!) to give a not-so-clean global system. I am not entirely convinced in the use of TDD as an exclusive approach to design, this lone experience aside.

No comments: