Red Echo

November 4, 2009

This essay certainly contradicts the prevailing wisdom, but it makes some reasonable points. It’s OK Not to Write Unit Tests:

I’m not saying that all unit tests are worthless, nor that you should never write one ever again. But I am suggesting that you take a good hard look at the time you’re spending and ask yourself what benefit you are really deriving.

What I’m saying is that it’s okay if you don’t write unit tests for everything. You probably have already suspected this for a long time, but now you know. I don’t want you to feel guilty about it any more.

Test what can fail. Test stuff that’s easy to test. But don’t beat yourself up trying to get 100% code coverage. 100% code coverage doesn’t mean all that much, anyhow.