Sunday, February 07, 2010

Measure Twice, Cut Once

Unit testing offers software developers a parallel insight into the world of physical construction: measure twice, cut once. Whether you're in charge of putting together a wooden tie-rack or a sky scraper, it's slightly more than just inconvenient to find that someone in the process delivered the wrong sized artifact because they were rushing and only looked over their work once. A second pair of eyes, a buddy check, even double checking on the developer's own part can reduce the occurrence of these kinds of errors. Unit tests are a great tool for software engineers in this regard. We code up the business logic once, and then we get to test it from an alternate perspective (please, for heaven's sake, don't mimic the exact flow of logic in your unit tests: even if there's a bug your tests will erroneously pass!)

No comments: