4 ms·
I disagree. Test coverage is a wonderful metric. 100% coverage is a feel-good metric. I can easily achieve 100% coverage with bad tests. But I routinely use co
by bphogan 16y ago
I disagree. Test coverage is a wonderful metric.
100% coverage is a feel-good metric. I can easily achieve 100% coverage with bad tests. But I routinely use coverage as my guide to find things that might benefit from further testing, as in "oooh this path is never tested and stuff is more likely to break here".
I try really really hard not to write useless tests-I use tests to drive the development of my app. I need feature x, so I write a test for it. I end up with relatively high coverage because of that. And because I've gotten more disciplined over the years, I'm only implementing the stuff that passes my tests, so I'm less likely now to have things that aren't covered.
So, I view coverage as a guide, not a rule, but it's not a useless metric at all unless you designate an arbitrary percentage.