Tesugen

Test-first programming

My friend and colleague Malte and I work on the same project although we’re located 500 km from each other, but yesterday he came to Stockholm for two days so we could do a little pair programming on some new stuff.

Having read the latest drafts of the fortcoming book on test-first programming, by Kent Beck, we tried using a “test list”, which felt really good. Also, I had been thinking about how to cure myself from the “mock disease”—that is, after having read about mock objects you want to solve all test problems using them—and we actually managed to write the tests without using mocks at all. That also felt good.

The things we’re doing now felt really complicated, but after some refactoring our classes are really lean and I feel that the rest of the stuff fits into the design we ended up with. This was a school-book example of where you should ignore any preconceptions regarding possible solutions and just drive yourself with tests in really small steps. Had we tried to design the solution fully in advance, the result couldn’t have ended up this simple—especially if we didn’t design longer than a day and a half, which is how much time we spent programming.

The above was posted to my personal weblog on April 3, 2002. My name is Peter Lindberg and I am a thirtysomething software developer and dad living in Stockholm, Sweden. Here, you’ll find posts in English and Swedish about whatever happens to interest me for the moment.

Posted around the same time:

The seven most recent posts:

  1. Tesugen Replaced (October 7)
  2. My Year of MacBook Troubles (May 16)
  3. Tesugen Turns Five (March 21)
  4. Gustaf Nordenskiöld om keramik kontra kläddesign (December 10, 2006)
  5. Se till att ha två buffertar för oförutsedda utgifter (October 30, 2006)
  6. Bra tips för den som vill börja fondspara (October 7, 2006)
  7. Light-Hearted Parenting Tips (September 16, 2006)
Bloggtoppen.se