Automated Unit Test Coverage and TDD: A Means to an End

June 3, 2014

“We have 100 percent coverage with our automated unit tests.” Based on this statement, would you feel confident that new features can be added the system covered by these tests quickly and easily? That the code can be updated with confidence because adverse side-effects will be caught immediately by automated unit tests?

If you answered “yes” to these questions, you may be in for a surprise. Automated code coverage isn’t measuring everything you need to know about your code base any more than your speedometer on your car is measuring how safely you are driving. Your speedometer is a gauge, providing a metric that you need to consider along with other factors, such as:
  • Are you driving at the posted speed limit?
  • Are you driving in inclement weather?
  • Are you texting while driving?
Conditions provide context. If you are driving on an icy road in a snowstorm, it’s a good bet that driving the posted speed limit is unsafe. And 100 percent code coverage is meaningless if we can’t add new features to the system quickly and easily, or at the very least catch adverse side-effects immediately when we do update the code.