Test coverage measures how much of the code is executed by tests — typically as a percentage (e.g. 80% coverage). It's a useful metric for finding untested code, but it's important to understand its limitations: high coverage doesn't guarantee good tests.
What coverage measures
TEST COVERAGE = the % of code exercised by the test suite:
LINE coverage → % of code lines executed by tests
BRANCH coverage → % of branches (if/else paths) taken
FUNCTION coverage → % of functions called
STATEMENT coverage → % of statements executed
→ Coverage tools instrument the code and report what tests do/don't exercise.
