Unit testing is a lot like going to the gym

My first answer on Stack Overflow.  Possibly too metaphorical.

Tags:

One Response to “Unit testing is a lot like going to the gym”

  1. Michael Higgins says:

    I liked your response. Unfortunately, I can’t vote it up because I lack “15 reputation”, whatever that is ;-)

    Like going to the gym, peer pressure helps. It’s hard to write unit tests if you’re the only person who ever looks at your code. But if you know someone else is going to be mucking around with it, it gives you some insurance that they won’t completely break all your lovely features.

    (I’m not saying you shouldn’t do it if you’re working alone, just that it’s harder to motivate yourself.)