Code coverage measures how much executable code a test suite exercises. It reveals untested areas, especially overlooked error-handling paths, but coverage alone does not prove quality. section 6.5
Measure JavaScript coverage by:
- Loading the source files. section 6.5
- Instrumenting the code with tracker lines that record statement execution. section 6.5
- Connecting the test runner to a report showing executed lines and coverage percentages. section 6.5
A coverage result
A QUnit test that exercises only the valid path of an imperative showStudent function executes 12 of 15 lines, producing 80% coverage. A corresponding functional version reaches 100% for its testable business logic.













