Gitar Logo
Back to Glossary

Code Coverage

Code Coverage tells you how much of your code is actually tested – and what is left exposed to bugs that your test suite will never catch.

What Is Code Coverage?

Code Coverage is the percentage of a codebase exercised by automated tests, used to measure the thoroughness of a test suite. It tracks which lines, branches, and functions are executed when the test suite runs – and, by implication, which are not.

Code coverage is measured across several dimensions: line coverage tracks which lines of code were executed; branch coverage tracks whether both true and false branches of conditional statements were exercised; and function coverage tracks which functions were called at least once. Each dimension reveals a different class of gap in test thoroughness.

High code coverage does not guarantee that a codebase is well-tested – tests can execute code without making meaningful assertions about its behaviour. But low coverage is a reliable indicator of risk: code that is never executed by the test suite can harbour bugs that will only be discovered in production.

Coverage metrics are most useful when tracked over time and applied at the pull request level – flagging changes that reduce coverage or introduce new code paths without corresponding tests. This makes coverage a property that is actively maintained rather than periodically audited.

Related Terms

Frequently Asked Questions

Try Gitar Today

Try Gitar today

AI code review that fixes your code and validates against CI. Try free for 14 days.