Test Coverage Calculator
Calculate line coverage, branch coverage, and overall test coverage percentage. Track your test suite quality and identify coverage gaps.
How to Use the Test Coverage Calculator
- Enter total lines and covered lines.
- Enter total branches and covered branches.
- Click Calculate to see line, branch, and overall coverage.
使用例
- •Tracking test coverage metrics in CI/CD pipelines.
- •Setting coverage gate thresholds for pull requests.
- •Identifying under-tested modules for refactoring.
- •Reporting code quality metrics to stakeholders.
計算式
Line coverage = covered lines / total lines × 100%. Branch coverage = covered branches / total branches × 100%. Overall = average of both.
よくある質問
What is good test coverage?
80% line coverage is a common target. 100% is ideal but often impractical. Branch coverage is more meaningful than line coverage.
What is branch coverage?
Branch coverage measures whether both true and false outcomes of conditional statements have been tested.
Can 100% coverage mean bug-free code?
No — coverage measures execution, not correctness. You can have 100% coverage with poor assertions and still have bugs.