code coverage
A measurement of which parts of your code ran while the tests ran.
In more detail
Coverage measures exercise, not examination: a line counts as covered even if no assertion ever looked at its result. The useful part of a report is the list of missing lines, which shows code the suite has never run. Treat it as a diagnostic for deciding what to test next, never as a target.
Related terms
- test report — A file written by a test run that records which tests passed and failed.
- include and exclude — Matrix keys that remove combinations from the expansion (exclude) or add jobs or properties to it (include).
- line coverage — The share of lines or statements in your code that the tests executed at least once.
- branch coverage — A measurement of whether each decision in the code, such as an if statement, was taken both ways during the tests.
- coverage gate — A rule that fails a build when code coverage falls below a set percentage.
- pytest-cov — A pytest plugin that runs coverage.py during the test run and prints a coverage report at the end.
Taught in
- CodeBuild: The Build That Passed With Failing Tests — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Monitoring As Code: The Alarm That Watched Nothing — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Automating Data Protection: Keys, Secrets And A Partner Shortcut — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Passing Data Between Jobs: Artifacts — Continuous Integration & Continuous Delivery Pipelines
- Scaling with Matrix Builds — Continuous Integration & Continuous Delivery Pipelines
- Coverage: Diagnostic, Not Target — Automated Testing, TDD & Quality Engineering