Test coverage only matters if it's at 100%
1–10 of 53 posts
Re: Test coverage only matters if it's at 100%
#2Re: Test coverage only matters if it's at 100%
#3There is actual empirical evidence that this is false.
Re: Test coverage only matters if it's at 100%
#4There is actual empirical evidence that this is false.
Re: Test coverage only matters if it's at 100%
#5There is actual empirical evidence that this is false.
The author makes a good point -- everything should either be covered by tested or explicitly marked as excluded. Having a gray area of code that is included but not covered by tests is a recipe for missing something. That much seems obvious.
Re: Test coverage only matters if it's at 100%
#6There is actual empirical evidence that this is false.
Feels like you didn't the read the (whole) article. The author makes a good point -- everything should either be covered by tested or explicitly marked as excluded . Having a gray area of code that is included but not covered by tests is a recipe for missing something. That much seems obvious.
Re: Test coverage only matters if it's at 100%
#7There is actual empirical evidence that this is false.
Feels like you didn't the read the (whole) article. The author makes a good point -- everything should either be covered by tested or explicitly marked as excluded . Having a gray area of code that is included but not covered by tests is a recipe for missing something. That much seems obvious.
Re: Test coverage only matters if it's at 100%
#8Test coverage clearly matters even if it's not 100%, as anyone who has ever worked on an older codebase knows.
As long as you're not causing coverage regressions, it is perfectly acceptable to leave untested code that "should" be tested, but hasn't been changed in years.
Test it when you change it; don't test for the sake of achieving a coverage benchmark.
Re: Test coverage only matters if it's at 100%
#9At a previous shop, we had a simple test that ensured user could log in for a while, until we created more coverage. We didn't test every aspect of the code. This simple sanity check saved us once or twice.
Should we have not written this test just because we couldn't test every conceivable piece of code?
Don't let perfect be the enemy of good...
Re: Test coverage only matters if it's at 100%
#10That said, if you have a single test, that better than no tests. And 90% is better than 80%. Yes, 100% is ideal, but if you let perfect be the enemy of good, than you waste time when low hanging fruit breaks.