← Design Verification Interviews
Interview Question · Concept
Full Code Coverage and a Bug Escape
The Question
The interviewer asks
Your block reached 100% code coverage, yet a bug escaped to silicon. How is that possible, and what does functional coverage add?
You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Code coverage measures which lines, branches and toggles of the RTL ran. It cannot see a check that was never written, or conditions that never happened together. Functional coverage measures the cases in the spec and the plan, such as "push while full". A missing feature then shows up as an empty bin. You need both: code coverage finds RTL nobody exercised, and functional coverage finds intent nobody tested.
Read the diagram as text
- Spec: A push into a full counter is ignored
- RTL: Reset, increment and decrement lines; no full check
- Coverage plan: Row: push while full
- Code coverage: Every line ran at least once
- Bin push_full: 0 hits, so a test is missing
- The missing check: No line exists, so nothing is counted
- Spec → Coverage plan: listed in
- Coverage plan → Bin push_full: coded as
- RTL → Code coverage: lines counted
- Code coverage → The missing check: cannot see
In the run every line ran, yet the push-while-full bin has 0 hits. Code coverage counts the RTL that exists; functional coverage counts the cases in the spec.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Fresher)
A good fresher answer says code coverage can only count lines that exist in the RTL. It gives one example, such as a full check that nobody wrote.
What Interviewers Listen For (Junior)
A good junior answer names the exact bin that would have caught the escape, such as push while full. It also says where to sample it.
What Interviewers Listen For (Senior)
A good senior answer explains what sign-off needs from both reports. Every code coverage hole has a reason, and every functional hole is closed or waived with a reason.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
WhyWhat IfProve ItCompareScale It
- Full Code Coverage and a Bug Escape
-
WhyWhy Code Coverage Cannot See Missing LogicL0 FresherL1 Junior
Why can't code coverage find a feature that was never implemented?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
A code coverage tool adds counters to the lines and branches that exist in the RTL. A check that was never written has no line, so there is nothing to count. The report can only ever say "this code ran" or "this code did not run". Functional coverage starts from the spec, so it can list cases the code does not handle.
Self-Check
Tick each key point you covered in your answer.
Misconception
"Branch coverage finds it, because the missing
ifleaves a branch untaken."A branch that was never written has no counter. Branch coverage measures the branches the RTL has.
Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §25.1.1 (PDF p442)
-
CompareLine, Branch, Toggle, Expression and FSM CoverageL1 Junior
Compare line, branch, expression, toggle and FSM coverage. Which one would have caught the missing full check?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Line coverage counts executed statements, and branch coverage counts each way through an
iforcase. Expression coverage checks that each term of a condition changed the result. Toggle coverage checks each bit went to 0 and 1, and FSM coverage counts states and arcs. None of them catches the missing check, because the conditioncount == 4does not exist in the code.Kind What it counts Sees the missing full check? Line Statements that executed No Branch Each way through an iforcaseNo Expression Each term of a condition changing the result No Toggle Each bit going to 0 and to 1 No FSM States and arcs of a state machine No The condition
count == 4is not in the code, so no kind of code coverage has anything to count.Self-Check
Tick each key point you covered in your answer.
Misconception
"Expression coverage would flag the missing
count == 4term."Expression coverage measures the terms that are written. A term that is absent from the condition is invisible to it.
Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §25.1.1 (PDF p442)
-
Prove ItThe Bin That Would Have Caught ItL1 Junior
Prove it: write the functional coverage that would have exposed the missing full check.
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Cover the operation crossed with the fill state, sampled only outside reset. For example,
push_full: coverpoint (push && count == 4) iff (!rst) { bins seen = {1}; }. A fuller model crosses push and pop with empty, partial and full. The empty bin forces someone to write the test, and that test finds the overflow.Self-Check
Tick each key point you covered in your answer.
Missed Corner
"Cover the count value from 0 to 4; that includes full."
The count does reach 4. The missing case is a push while it is 4, which is an operation crossed with a state.
Source Mehta, SystemVerilog Assertions and Functional Coverage (3rd ed.), §27.1 (PDF p502)
-
What IfCode Holes in an Error-Recovery BranchL2 Mid-Level
Asked if they ask about the remaining code holes
Code coverage is 97%. The holes are in an error-recovery branch. What do you do with them?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Find out first whether the branch can be reached. If it can, the plan missed a feature: add it to the plan and write the test, often with error injection. If it cannot, because of a tie-off or a parameter, mark it unreachable with a reason the designer agrees to. Never waive a hole just because it is hard to hit.
Self-Check
Tick each key point you covered in your answer.
Wrong Altitude
"Error paths are rare in silicon, so waive them."
Recovery logic runs exactly when something has already gone wrong. A bug there turns a recoverable error into a hang.
Source Spear & Tumbush, SystemVerilog for Verification (3rd ed.), §9.2.1 (PDF p363)
-
Scale ItClearing Hundreds of Code HolesL3 Senior
At sign-off, hundreds of code coverage holes remain across a subsystem. How do you clear them without writing hundreds of tests?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Run a formal unreachability check on the holes first. It proves many of them dead, such as logic behind tied-off inputs or unused parameter values. Those can be excluded, with the proof as the reason. Review the rest with the designers, grouped by feature. Each group becomes a test, a plan update or a reviewed waiver.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Senior)
A good senior answer first uses a formal tool to shrink the list of holes. It then reviews the rest with the designers, feature by feature, and gives each waiver an owner.
Half-Truth
"Formal says the hole is unreachable, so the design is fine there."
Unreachable under the formal setup only. Wrong assumptions or tie-offs can make reachable logic look dead, so review the constraints too.
Source Seligman, Schubert, Kiran Kumar, Formal Verification (2nd ed.), ch. 9, vacuity and wrong assumptions (PDF p310)
-
Prove ItSolve 7.5.8: Two Coverpoints for the FIFOSimulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
What People Get Wrong
Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.
Misconception
"Every line ran, so the design is verified."
The twin runs every line of a counter whose full check was never written. Functional coverage of push-while-full is 0%, and a fifth push overflows.
Run It
A counter with a missing full check. Line hits are counted by hand, as a line-coverage report would.
line hits: reset=1 increment=4 decrement=4 (every line ran) functional coverage, push while full: 0.00 after a fifth push: count=5 (the spec says 4) FAIL: every line ran, but no test pushed into a full counter, where the missing check livesHalf-Truth
"Functional coverage is the better metric, so skip code coverage."
Code coverage finds RTL the plan forgot, such as an untested mode or a dead branch. Each metric sees holes the other cannot.
Source Spear & Tumbush, SystemVerilog for Verification (3rd ed.), §9.2.1 (PDF p363)
Misconception
"100% toggle coverage means every value of the bus was seen."
Toggle coverage only checks that each bit went to 0 and to 1. It says nothing about which combinations of bits appeared.
Source Spear & Tumbush, SystemVerilog for Verification (3rd ed.), §9.2.1 (PDF p363)