Skip to main content
Testing Fundamentals
DEFINITION

What is Test Coverage?

Test coverage is a metric that measures the extent to which a test suite exercises the application, expressed as a percentage of code lines, branches, requirements, or features verified by tests. High coverage shows what has been executed, not what has been checked; a test can run every line and assert nothing.

No account needed · Scored in under a minute against a senior rubric

IN DEPTH

What does Test Coverage mean in practice?

Test coverage exists in two flavors: code coverage (how many lines, branches, or paths the tests execute) and requirements coverage (how many specified requirements have at least one associated test). Both are useful but incomplete. High code coverage does not guarantee the tests assert anything meaningful, and requirements coverage misses edge cases not captured in specifications.

The most common code-coverage metrics are line coverage (percentage of executed lines), branch coverage (percentage of decision branches taken), and function coverage (percentage of functions called). Tools like Istanbul/NYC for JavaScript, JaCoCo for Java, and coverage.py for Python instrument the code and generate reports.

Coverage is a helpful diagnostic, not a target. Mandating 100% coverage leads to brittle tests that assert implementation details. A more practical approach is to track coverage trends (is it rising or falling?), set minimum thresholds for critical modules (e.g., 80% branch coverage on payment logic), and use coverage gaps to guide where to add tests next.

WHY IT MATTERS

Why do interviewers ask about Test Coverage?

Interviewers ask about coverage to see whether you understand its value and limitations. The best answer acknowledges that coverage is a useful indicator but not a quality guarantee.

EXAMPLE

What does Test Coverage look like in a real project?

A team achieves 95% line coverage but discovers a production bug in the checkout flow. Investigation reveals the tests execute the discount calculation line but never assert that the output is correct. The line is "covered" but not verified. The team adds assertion-based tests targeting the discount logic.

TIP

How should you talk about Test Coverage in an interview?

Distinguish between code coverage and requirements coverage. Mention that high coverage with weak assertions creates false confidence. Discuss how you use coverage data to find gaps rather than as a pass/fail gate.

Related Resources

Dive deeper with these related interview prep pages.

FREE TOOLS  /  no signup

Free QA career tools, no account needed

Instant and private, everything runs in your browser. Try them before you sign up.

EXEC.NOW

Ready to Ace Your QA Interview?

Practice explaining test coverage and other key concepts with our AI interviewer.

Join 500+ QA engineers already practicing with AssertHired.

Question 1 · Automation · Mid-levellive scoring

A test passes locally but fails in CI about one run in five. Walk me through what you check first, and why.

Scored on the same four dimensions as the real thing: Technical accuracy · Coverage · Clarity · Best practices.

Rather skip ahead? Create a free account

FREE.TO.START  ·  7.DAY.TRIAL ON PAID PLANS
Written by , Senior QA Automation Engineer, 50+ QA candidate interviews conductedLast updated July 2026