Member-only story
Many companies have used code coverage as a prerequisite for code submission. Nevertheless, this may not necessarily be a good metric. This is a brief reflection on what I learned after reading Software Engineering at Google: Lessons Learned from Programming Over Time Chapter 11: Testing Overview.
Many companies have used code coverage as a prerequisite for code submission; for instance, they would require that X% of the code lines of the impacted files must be executed by the unit tests for submission. This is often held up as a gold standard metric, but it may not be a good metric as it seems.
It is possible to execute a large number of lines without checking what they are actually doing. It relies on the configuration of the unit tests.
Moreover, while code coverage is intended to be a minimum requirement, in practice, engineers will treat it as a ceiling and move on after fulfilling the minimum code coverage requirement. After all, they are not incentivized to do more than the code coverage requirement.
It could lose a lot of contexts on measuring the effectiveness of the unit tests by solely relying on a single test coverage percentage.