DEV Community

Discussion on: 100% Unit Test Coverage — Is that a Myth?

Collapse
 
miniscruff profile image
miniscruff

My biggest issues with the 80%, or sometimes the notion of testing the most common paths only. Is that if/when something does go wrong, you have much less data on it then normal. With few interactions with those paths in your code, you get less debugging opportunities. And, when it goes wrong it will be harder to reproduce on your end.

I have been doing 100% statement and branch coverage for everything after our base PoC. That is, the first mini-release is fine at no coverage as it is used to verify this idea even holds water. And can be used to fine tune any CI/CD or DB infrastructure.

However, I think people confuse 100% with perfect systems. 100% is the baseline, there will still be bugs. And you still have to adjust over time.