# Alternate Code Coverage Metrics

DevFeed: [Alternate Code Coverage Metrics](<https://devfeed.tech/articles/alternate-code-coverage-metrics-33394.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2012/04/18/code-coverage-metrics>)

Published: 2012-04-18T00:00:00Z

Content type: opinion

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Test-driven development](<https://devfeed.tech/topics/tdd.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [metric](<https://devfeed.tech/tags/metric.md>), [quality](<https://devfeed.tech/tags/quality.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>)

## AI overview

This commentary examines the limits of code coverage as a measure of software quality. It argues that happy-path tests can produce reassuring coverage numbers while missing important cases, and proposes combining overall coverage with the percentage of classes reaching 100% coverage. It also warns that tying incentives to code metrics can create harmful outcomes.

## Source excerpt

Code coverage has been a controversial topic for a number of years. Just about everyone agrees that unit testing is beneficial. The hardcore TDD folks push for 100% coverage, while everyone who's trying to make money has realized that the last 1-5% can be very expensive code to test. So the conumdrum is knowing how much to test. How many tests need to be written to get a high level of quality? I like a tweet from Jimmy Bogard