←back to thread

873 points belter | 1 comments | | HN request time: 0.201s | source
1. nitwit005 ◴[] No.42957449[source]
> Code coverage has absolutely nothing to do with code quality (in many cases, it's inversely proportional)

My theory from working at a company that demanded high unit test coverage is that it encourages coding patterns that are easier to create coverage for. Not necessarily easier to genuinely test, but easier to get a high coverage metric.

For example, try/catch blocks are bad if you want coverage. Now you have to do things like inject exceptions. People will try to design things so that's not required, with odd side effects.