Mid-LevelQA Methodology & Strategy
Explain the concept of test coverage and its limitations.
- test coverage
- code coverage
- metrics
- limitations
Answer it first, then compare. Nothing here is saved or scored.
Model answer
Test coverage measures what percentage of code/features is exercised by tests. Types: (1) Code coverage (line, branch, function): measured by tools like Istanbul/nyc. (2) Requirements coverage: which requirements have tests. (3) Risk coverage: which risk areas are tested. Limitations: (1) High coverage does not mean high quality, 100% line coverage can still miss bugs. (2) Coverage measures execution, not assertion quality. (3) Chasing coverage numbers leads to low-value tests. (4) Cannot cover all input combinations. Use coverage as a guide to find untested areas, not as a quality metric.
What interviewers listen for
- Risk-based prioritisationYou can defend skipping coverage on a path because the risk maths supports it.
- Test design fluencyYou apply equivalence partitioning and decision tables to concrete inputs in real time.
- Metric judgmentYou distinguish between metrics that drive learning and metrics that drive theatre.
- Strategy under constraintYou can produce a defensible plan when the team has half the time and twice the scope.