Hacker News new | ask | show | jobs
by IshKebab 1043 days ago
100% code coverage doesn't guarantee there are no bugs, but less than 100% code coverage does mean that there is code that you definitely aren't testing.

To put it another way, code coverage isn't a direct measure of how good your testing is, but it is still a useful metric to try and improve.

In most cases 100% is too hardcore a target, but you should probably aim for at least 80%.

1 comments

Tom from Codecov here. This is so true, 80% is usually a much more reasonable approach. It’s better to write good tests than all the tests.

(Shameless plug) I wrote a short post about this here: https://about.codecov.io/blog/the-case-against-100-code-cove...

I really liked the blogpost! We're hoping to change point 2 (Engineering Time is Finite) with Sweep, so hopefully we don't have to make a tradeoff between a high quantity/quality of tests.