Wednesday, July 1, 2009

"The Flawed Theory Behind Unit Testing"

A nice, quick piece pointing out the real value in testing: they make you think harder about what you're doing. He omits it, but it seems like refactoring gets its benefits from much the same reasons.

My point is that we can't look at testing mechanistically. Unit testing does not improve quality just by catching errors at the unit level. And, integration testing does not improve quality just by catching errors at the integration level. The truth is more subtle than that. Quality is a function of thought and reflection - precise thought and reflection. That’s the magic. Techniques which reinforce that discipline invariably increase quality.


http://michaelfeathers.typepad.com/michael_feathers_blog/2008/06/the-flawed-theo.html