How I got into TDD


How I got into TDD

Three things I hate: bugs, debugging, and manual testing.

Years ago, I built a reputation for writing (relatively) bug-free code. My methodology was:

  1. Write a procedure
  2. Run the code in the debugger and trace through the code paths
  3. Build up a library of tested procedures

This worked. The problem was that changing a tested procedure required repeating the manual tests. I hated maintenance, and would argue against feature requests that affected the existing design. Unfortunately, maintenance and change requests are a large percentage of our jobs.

At a Borland Convention one year, I went to a seminar on reducing bugs in Delphi applications or some such. (I don’t remember who presented it; an Australian fellow, I think.) The speaker spent some time on Unit Testing and test frameworks; I was intrigued.

Eventually, I found that automated tests kept me out of the debugger. I no longer hated or feared changes.

Reading Beck (XP) and Fowler (Refactoring) taught me that complex code is hard to change and prone to bugs, while simple code is easy to change and debug.

I still write stable code. I just enjoy it more.

Your Host:
Copyright © 2000-2013 by William Sorensen. All rights reserved.