3 ms·
I always say between 60-80%, 60% for greenfield or new testing as that is generally right for covering the golden path(s) and the major error cases. It should s
by eikenberry 6y ago
I always say between 60-80%, 60% for greenfield or new testing as that is generally right for covering the golden path(s) and the major error cases. It should slowly grow over time as bugs get tests written for them, but if it gets over 80% you probably want to refactor some.
>80% test coverage digs way to far into the code, testing the implementation instead of the interfaces/apis. It is a definite code smell that probably means the tests were written poorly and need some major reworking.
- capableweb 6y ago> that is generally right for covering the golden path(s) and the major error cases The thing is, your metric of 50-80% has nothing to do with if you're actually covering the golden path(s) and major error cases. The error cases you didn't think of, wouldn't count in this metric of course, but they might still be missed. Code coverage as a metric says as much as number of lines as a metric. Meaning nothing, it's just a number. Aiming at any sort of code coverage metric misses to think about what to actually cover. 0 code with 0 tests has 100% code coverage, doesn't mean it's actually a good program.