Code coverage measures the ratio of production-code lines executed by at least one test to the total number of production-code lines. It provides useful feedback about what tests reach, but it cannot measure test-suite quality by itself. section 1.3
Figure 1.3. The code coverage (test coverage) metric is calculated as the ratio between the number of code lines executed by the test suite and the total number of lines in the production code base.
Use the ratio diagram to distinguish executed production-code lines from the total code base. section 1.3
A partially covered method
A test calling IsStringLong("abc") executes the false path and verifies the result. The test therefore reaches some method lines, while the longer-string path remains untested. A test with no assertions could execute both paths yet provide no evidence that either behavior is correct. section 1.3
Interpret coverage numbers as feedback rather than a quality target:
- Treat low coverage as a warning that important code may be insufficiently tested. section 1.3
- Do not treat high or complete coverage as proof of a good test suite. section 1.3
- Prefer valuable tests for important code over imposing a universal coverage threshold; branch coverage offers more insight but still omits assertions and third-party paths. section 1.6













