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.
Free to start · 7-day trial on paid plans
In depth.
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 interviewers ask about this.
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 scenario.
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.
Interview tip.
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 Terms
Explore related glossary terms to deepen your understanding.
Related Resources
Dive deeper with these related interview prep pages.
Free QA career tools, no account needed
Instant and private, everything runs in your browser. Try them before you sign up.
QA Resume Checker
Instant 0-100 score on automation keywords, impact, and ATS formatting.
QA Cover Letter Generator
A tailored 3-paragraph QA cover letter from your resume and a job post.
QA Application Tracker
Drag-and-drop kanban to track every QA application from Applied to Offer.
QA Take-Home Test Generator
A realistic take-home assignment with a scenario, tasks, and a rubric.
QA LinkedIn Headline Generator
A recruiter-searchable headline, About section, and skills list.
QA STAR Story Builder
Structure a QA behavioral answer with the STAR method and instant checks.
QA Bug Report Generator
Build a clean, reproducible bug report for Markdown, Jira, or plain text.
Boundary Value Analysis Generator
Generate boundary value and equivalence partitioning test cases from a range.
QA Metrics Calculator
Calculate DRE, defect leakage, defect density, and pass rate with interpretation.
QA Test Plan Generator
Build a structured test plan (scope, approach, criteria, risks) in Markdown.
QA Salary Calculator
Estimate QA, SDET, and automation tester pay by level, market, and skills.
QA Offer Evaluator
See total comp, a counter range, and a ready-to-send negotiation message.
Ready to Ace Your QA Interview?
Practice explaining test coverage and other key concepts with our AI interviewer.
Join 1,200+ QA engineers already practicing with AssertHired.
Start your free QA interviewCurious how it works first? See the QA mock interview