Fog Creek Software
Discussion Board




Unit tests as daily affirmations

I think that all major users of unit tests might just have a little Stuart Smalley in them, without the explicit spoken daily affirmations.  After talking with my wife tonight, I realized that  one of the reasons I like unit tests, is because its like a big list of affirmations of my coding ability.

There's nothing quite like making a few changes, re-running your full test suite, and seeing 100+ "ok"s fly down the screen. 

So thats my little theory: people like unit tests because they tell them that they're doing OK.

Andrew Hurst
Wednesday, December 03, 2003

Interesting point. I also like the extra confidence they give you when refactoring code.

Matthew Lock
Wednesday, December 03, 2003

It tells them what they bothered to test in an isolated
environment is ok.

son of parnas
Wednesday, December 03, 2003

I have my unit tests run when I start my environment.  It's basically a feeling that no matter what my life is like, at least I'm entering a world where my code works.  And I've written my own test harness, which I think is better than xUnit, so there are qualitative advantages there.  In fact, using my test harness is when I start throwing corner cases at my code, so it's like having a little war against my former self who wrote the code.

Some might argue that I should have just proven my code to start out with, or at least use a spec, but these tests really facilitate that style where you gain a better appreciation of desired features once you've started writing it.

Tayssir John Gabbour
Wednesday, December 03, 2003

*  Recent Topics

*  Fog Creek Home