Thursday, August 26, 2010

Code Test Haiku

Function works first time
Briefly feel elation...
Did it really work?

Having code work the first time is more annoying than having it fail.

If it doesn't work I go poke around to fix the failing tests, and when it finally passes I feel confident that it really works.

When code works the first time I still go poke around in the unit tests, only this time I have no idea what I'm looking for. Did it really get tested? Does it really test what I think its testing? Surely there is something wrong somewhere.