Feature Coverage vs Code Coverage: What’s the Difference and Why it Matters
You know what business folk care about? Teams delivering stuff that solves their problems or helps them do their job more easily or faster — or that makes them more money.
You know what they DON’T care about? Vanity metrics.
And you know what we tend to focus WAY too much of our time on?
You guessed it — vanity metrics!
Take code coverage, for example.
Code coverage measures the degree to which the source code of a program has been executed during testing. People often use it as a way of determining the percentage of code that has been tested.
Code coverage is what I call a “negative metric”. It can be really helpful in identifying areas of the code that might need more attention or additional testing to ensure that the software performs as intended.
But in many ways, code coverage is a classic vanity metric. It’s dead-easy to game (I can write tests that give you near 100% coverage that don’t test a thing!), and does not actually guarantee that your code is well tested.
And paradoxically, the more you mandate code coverage among your developers, the less likely you are to have well tested code!
Want to measure something the business actually care about?
Try Feature Coverage instead.