Tesugen

Morning testing idea

As I stood up this morning, I had an idea in my head. It wasn’t a solution to a problem I’ve been thinking about, or anything, and it isn’t widely applicable either. But I just thought I should write it down.

When unit testing, one pattern is the Journalling Pattern (which is called “Log String” in the upcoming book on test-driven development), where you subclass your testee and keep a log of which methods are called and in what sequence. This pattern is a more light-weight alternative to Mock Objects and should be considered before venturing into the deep and dark mock forest.

Anyway, sometimes it is a requirement that the software should log stuff – especially with server software with lots of remote users, where the feedback of bugs is really lousy. My idea was that if you keep a log, you might consider to use it to test the internals of your code just as well. What I like about this is that you “reuse” an element of the code for testing purposes. (If you’re doing true test-driven development, you “have” to test the log, of course.)

The above was posted to my personal weblog on April 14, 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.

Tags:

Related posts:

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