OhMyCalc

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

  1. Enter total lines and covered lines.
  2. Enter total branches and covered branches.
  3. Click Calculate to see line, branch, and overall coverage.

Casos de Uso

Fórmula

Line coverage = covered lines / total lines × 100%. Branch coverage = covered branches / total branches × 100%. Overall = average of both.

Perguntas Frequentes

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.