Cover image: How to think like a verification engineer, the 7-step method from spec to scenarios, and a real 4-bit ALU bench with 2,048 inputs checked and 3 planted bugs

How to Think Like a Verification Engineer: From Spec to Scenarios

In short: Thinking like a verification engineer means starting from the spec and asking, over and over, “how could this break?” before you write any code. You turn the spec into a list of normal, illegal, corner, timing and reset scenarios, decide how each one will be checked, and map each one to a coverage point. Syntax is a tool you can learn in a weekend. This way of thinking is the actual job.

Most people learning verification start with syntax: classes, constraints, UVM macros.

That’s useful. But it isn’t what interviewers test, and it isn’t what finds bugs.

What finds bugs is looking at a design and seeing ten ways it could go wrong that the designer didn’t write down. This lesson gives you a method you can repeat on anything, practises it on five everyday designs, and then runs it on a real 4-bit ALU, where you’ll see a scenario list catch three planted bugs.

By the end of this lesson, you’ll be able to:

  • Turn any spec into a full list of test scenarios with a fixed seven-step method.
  • Spot the scenario types beginners forget: illegal inputs, timing, concurrency and reset.
  • Turn each scenario into a check and a coverage point.
  • Answer the “verify this everyday object” interview question with confidence.

The picture: the building inspector

The builder follows the plan and expects the building to work. That’s the designer.

You’re the inspector. You walk every room, open every door, and flip switches in a strange order. What if two people call the lift at once? What if the power drops mid-ride? What if someone presses stop and start together?

You’re paid to find the problem before the customer does. That mindset, curious and a bit stubborn, is what turns a spec into a test plan.

The inspectorThe verification engineer
Reads the building planReads the spec
Lists every room and switchLists every mode, input and rule
Tries the odd cases on purposeWrites illegal, corner and timing scenarios
Writes down what “safe” looks likeBuilds checkers and a reference model
Ticks off each room visitedCollects functional coverage

How do you turn a spec into test scenarios?

Interviewers love to hand you an everyday object and say “verify it”. The trick is to follow the same steps every time, whatever the object:

  1. Understand the spec and ask questions. List every mode, input, output and rule. Write down every doubt and clear it before you start.
  2. Normal scenarios. What should work when everyone behaves.
  3. Illegal scenarios. Bad inputs, wrong order, values out of range.
  4. Corner and boundary cases. Zero, the maximum, the first and last value, the exact moment a mode changes.
  5. Timing and concurrency. Two things at once, or an event landing right on a clock edge.
  6. Reset, power and recovery. Reset in the middle of activity, power loss, recovery after an error.
  7. Decide the check. For each scenario, how will you know it passed? That becomes a checker, a scoreboard entry or an assertion, plus a coverage point.

Step 7 is the one beginners skip. A scenario without a check is a test that can’t fail.

From spec to scenarios, the seven-step method: understand, normal, illegal, corners, timing, reset, and the check, which adds a checker and a coverage point to every scenario
The same seven steps work on any design.

Why does this beat memorising syntax?

  • Bugs hide in the gaps between rules. The spec lists normal behaviour. The interesting failures live in what it doesn’t say.
  • Tools change, the questions don’t. SystemVerilog, UVM or formal, you still ask: what are the inputs, what’s illegal, what happens at the edges?
  • Everything else grows from the list. Checkers, scoreboards and coverage all come from the scenarios you imagined first.

How do you verify an everyday design? Four practice examples

A traffic signal

  • Normal: the colours go green, yellow, red in order, each for its specified time.
  • Illegal: two opposing directions both green. This must never happen.
  • Corner: power-up starts in a safe state, often all red or blinking.
  • Timing: no gap where every light is off, unless the spec allows one.
  • Recovery: a corrupted or zero timer value.
  • Check: an assertion that opposing greens never overlap, plus coverage of every legal transition and the off-hours blink mode.

A coffee vending machine

  • Normal: exact money, one drink, no change.
  • Illegal: not enough money. The machine must wait and not dispense.
  • Corner: out of stock, exact change unavailable, a coin jam.
  • Concurrency: two buttons pressed together. Only one selection is honoured.
  • Recovery: power loss mid-transaction, then a refund.
  • Check: a reference model of money in, drink out and change returned, plus coverage of every payment path.

A 2ร—2 packet switch

  • Normal: each packet reaches the output its address says.
  • Contention: both inputs target one output. Check the arbitration, and that no packet is lost.
  • Back pressure: the output isn’t ready. The switch must stall, not drop.
  • Corner: minimum and maximum length, a malformed header, a full buffer.
  • Check: a scoreboard per output that checks payload, length and order, plus coverage of every input-to-output pair.

A single-port RAM

  • Normal: write, then read back the same address.
  • Corner: address 0 and the last address, and an out-of-range access.
  • Patterns: all zeros, all ones, 0101 and 1010, walking ones. These catch stuck and shorted bits.
  • Conflict: a read and a write in the same cycle on the one port.
  • Check: a memory model in the testbench, compared on every read.

Does the method catch real bugs? A 4-bit ALU on VCS

The fifth design is small enough to test every input, so let’s actually do it.

The spec: two 4-bit operands, a 3-bit opcode selecting 8 operations (ADD, SUB, AND, OR, XOR, INC, SHL, SHR), a 4-bit result, and carry and overflow flags.

Running the seven steps gives this list:

StepScenarios
Normalevery opcode gives the right result
Illegalnone: all 8 opcodes are legal here, and the spec says so
Corneroperands 0, 15, 8 (sign bit set) and 7 (largest positive)
Flagscarry out of ADD, borrow in SUB, signed overflow in ADD, SUB and INC, bits shifted out of SHL and SHR
Checka reference model written from the spec table, compared on every input

With 16 ร— 16 ร— 8 = 2,048 combinations, the bench can check every single one. Bigger designs can’t, which is exactly why constrained random testing and functional coverage exist.

The bench planted three bugs, each one a different kind of scenario:

  • BUG=1: SUB sets carry the wrong way round. A broad bug in one operation.
  • BUG=2: INC never sets overflow. A flag bug that only shows at a = 7.
  • BUG=3: SHR shifts in a 1, but only when a = 15. A single-corner bug.

Real output, Synopsys VCS, all 2,048 combinations each run:

RunErrorsCoverageWhere the errors were
clean design0100.00%none: the checker passes a correct design
+BUG=1256100.00%every SUB, all 256 combinations
+BUG=216100.00%INC, only at a = 7
+BUG=316100.00%SHR, only at a = 15
Running with BUG=0
SUMMARY BUG=0 checked=2048 errors=0 coverage=100.00%

The clean run matters as much as the buggy ones. A checker that fails a correct design is just as broken as one that passes a wrong one.

Running with BUG=1
MISMATCH op=001 a=0 b=0 : got r=0 c=1 v=0, expected r=0 c=0 v=0
MISMATCH op=001 a=0 b=1 : got r=15 c=0 v=0, expected r=15 c=1 v=0
MISMATCH op=001 a=0 b=2 : got r=14 c=0 v=0, expected r=14 c=1 v=0
SUMMARY BUG=1 checked=2048 errors=256 coverage=100.00%

BUG=1 is the easy one. Every subtraction gets the borrow flag backwards, so all 256 SUB combinations fail. The first line shows it clearly: 0 minus 0 has no borrow, yet the design set carry.

Running with BUG=2
MISMATCH op=101 a=7 b=0 : got r=8 c=0 v=0, expected r=8 c=0 v=1
SUMMARY BUG=2 checked=2048 errors=16 coverage=100.00%

BUG=2 is narrower. The result is right, 7 + 1 = 8, but 8 doesn’t fit in a signed 4-bit number, so overflow must be set. Only a = 7 triggers it. That’s exactly the “largest positive” corner on the scenario list.

Running with BUG=3
MISMATCH op=111 a=15 b=0 : got r=15 c=1 v=0, expected r=7 c=1 v=0
SUMMARY BUG=3 checked=2048 errors=16 coverage=100.00%

BUG=3 hides in one value of a. Shifting 15 right should give 7. The design gave 15. Every other value of a works.

Now look at the coverage column. Every buggy run still reached 100.00% coverage. Coverage tells you the scenarios ran. Only the checker tells you they ran correctly. A test plan that stops at coverage would have passed all three bugs.

The point to watch: BUG=3 is the kind of bug that random testing can miss for a long time. It shows up because “operand = 15” was on the scenario list, and the coverage cross of opcode against operand corners makes sure that combination ran.

How do you know when verification is done?

Progress is measured against the verification plan: the features to verify, the testbench pieces to build, and the coverage points that prove each feature ran.

  • Early on: how complete is the environment, and how many planned tests and coverage points exist?
  • Middle: regressions run every night. Watch the pass rate, how many new bugs turn up each week, and functional coverage.
  • The healthy trend: new bugs slowing down while coverage climbs.

When are you done? In theory, when the design matches the spec for every possible input. In practice you can’t apply every input, so “done” is a level of confidence built from evidence:

  • The plan was reviewed against the spec.
  • Every test passes in regression, with all coverage goals met, and every unhit item explained.
  • Open bugs are fixed, or understood to have no design impact.
  • Key scenarios were checked in the waveform by eye.
  • Formal ran wherever it fits.
  • The bug-arrival trend looks like past projects that worked.

Common mistakes, with fixes

Coding before listing scenarios. You end up testing what’s easy to code, not what’s likely to break. Fix: write the scenario list first, even as plain sentences.

Testing only the happy path. Fix: give illegal inputs, corners and reset their own section in every list.

Forgetting concurrency. Two things happening at once often exposes the worst bugs. Fix: for every pair of inputs, ask what happens if both arrive together.

A scenario with no check. The test runs and “passes” without verifying anything. Fix: write the check in the same line as the scenario.

No coverage point. You can’t prove the scenario ran. Fix: map every scenario to a coverage point, like the opcode-by-corner cross in the ALU bench.

How AI helps (and where it doesn’t)

  • Widening your list. Describe a design and ask for normal, illegal, corner, timing and reset scenarios. Compare with your own list and keep what’s new.
  • Finding the gaps. Paste your scenario list and ask what’s missing.
  • Practising interviews. Ask for an everyday design you haven’t seen, write scenarios for it, then ask for feedback.

Where to be careful: an AI list can look complete and still miss the one scenario that matters for your design. It doesn’t know your spec’s history or your designer’s habits. Use it to check your thinking, not to replace it. Don’t paste confidential specs into public tools. For the bigger picture, read AI in ASIC verification.

Interview questions

These come up in almost every first verification interview. For more practice, see the SystemVerilog interview questions and the UVM interview questions. Try answering each one before reading the answer.

  1. What does it mean to think like a verification engineer? Starting from the spec and asking how the design could break, then turning those questions into scenarios, checks and coverage before writing test code.
  2. How would you verify a traffic light controller? Check every state and transition and its timing, that opposing greens never overlap, a safe power-up state, and recovery from a bad timer value. Cover every legal transition.
  3. Why can a 4-bit ALU be tested exhaustively, but a real design can’t? The ALU has only 2,048 input combinations. A real design’s input space is far too large, so we use constrained random and coverage instead.
  4. What’s the difference between a scenario and a check? A scenario is what you make happen. A check is how you know it behaved correctly. You need both.
  5. How do you know verification is complete? When coverage goals are met and explained, regressions pass, open bugs are resolved or understood, and the bug rate has flattened.

Practice challenge

Try this with a design that isn’t on this page:

  1. Pick an elevator controller for a 4-floor building.
  2. Write scenarios under all seven steps. Aim for at least 20.
  3. For each one, write the check in one line.

Then take the ALU bench and add a ninth operation, “rotate left”. Add it to the spec table, the design and the reference model, and run the sweep again. If the checker passes on the first try, try planting a bug in your rotate to prove the check works.

Frequently asked questions

What does it mean to think like a verification engineer?

Starting from the spec and asking, again and again, how the design could break. You turn those questions into normal, illegal, corner, timing and reset scenarios, each with a check and a coverage point, before you write test code.

Should I focus on syntax or on the thought process?

Both matter, but the thought process sets strong engineers apart. Syntax can be learned quickly. Seeing many ways a design can fail is the harder skill.

How do I write test scenarios for an everyday object in an interview?

Follow a fixed method: clear your doubts about the spec, then list normal, illegal, corner, timing and reset scenarios, and say how you’d check each one.

Why can’t we test every possible input?

For real designs, the input space is far too large. Only tiny blocks like a 4-bit ALU can be tested exhaustively. For everything else, constrained random plus coverage builds confidence.

How does this connect to functional coverage?

Every scenario you list becomes a coverage point. When the report shows those points as hit, you have evidence the scenarios really ran.

Full code

This file, with its expected output, is also on GitHub in the course repo: tav-verification-basics, 01-think-like-a-verifier.

One file: the ALU, a reference model written from the spec, an exhaustive sweep, a checker and coverage. On EDA Playground choose Synopsys VCS, set the top module to alu_tb, and run once with no options and once per +BUG= option. No UVM needed.

// alu_think_demo.sv : turn a spec into checks, then prove them, on a 4-bit ALU
// The Art of Verification | theartofverification.com
//
// Run options (one per run):
//   (none)    the clean design: all 2,048 input combinations checked
//   +BUG=1    SUB sets carry the wrong way round
//   +BUG=2    INC never sets overflow
//   +BUG=3    SHR shifts in a 1 instead of a 0, but only when a == 15
//
// Run on Synopsys VCS X-2025.06-SP1 (EDA Playground), 23 Nov 2026.
//
// Spec (8 operations, 3-bit opcode):
//   000 ADD  r = a + b        carry = unsigned carry out, ovf = signed overflow
//   001 SUB  r = a - b        carry = 1 when a borrow happens (a < b), ovf = signed overflow
//   010 AND  r = a & b        carry = 0, ovf = 0
//   011 OR   r = a | b        carry = 0, ovf = 0
//   100 XOR  r = a ^ b        carry = 0, ovf = 0
//   101 INC  r = a + 1        carry = unsigned carry out, ovf = signed overflow
//   110 SHL  r = a << 1       carry = bit shifted out (a[3]), ovf = 0
//   111 SHR  r = a >> 1       carry = bit shifted out (a[0]), ovf = 0

`timescale 1ns/1ns

int BUG = 0;

// The design
module alu4 (input  logic [3:0] a, b, input logic [2:0] op,
             output logic [3:0] r, output logic carry, ovf);
  logic [4:0] w;
  always_comb begin
    w = '0; r = '0; carry = 0; ovf = 0;
    case (op)
      3'b000: begin w = a + b; r = w[3:0]; carry = w[4];
                    ovf = (a[3] == b[3]) && (r[3] != a[3]); end
      3'b001: begin w = {1'b0, a} - {1'b0, b}; r = w[3:0]; carry = w[4];
                    if (BUG == 1) carry = !carry;                          // BUG=1
                    ovf = (a[3] != b[3]) && (r[3] != a[3]); end
      3'b010: r = a & b;
      3'b011: r = a | b;
      3'b100: r = a ^ b;
      3'b101: begin w = a + 1; r = w[3:0]; carry = w[4];
                    ovf = (a == 4'b0111) && (BUG != 2); end                // BUG=2
      3'b110: begin r = a << 1; carry = a[3]; end
      3'b111: begin r = a >> 1; carry = a[0];
                    if (BUG == 3 && a == 4'hF) r[3] = 1'b1; end            // BUG=3
    endcase
  end
endmodule

// The testbench: a reference model written from the spec, an exhaustive
// sweep, a checker and functional coverage
module alu_tb;
  logic [3:0] a, b, r;
  logic [2:0] op;
  logic carry, ovf;
  int checked, errors;

  alu4 dut (.*);

  // Reference model, written from the spec table above, not from the RTL
  function automatic void model(input logic [3:0] a, b, input logic [2:0] op,
                                output logic [3:0] er, output logic ec, eo);
    int s;
    ec = 0; eo = 0;
    case (op)
      3'b000: begin s = a + b; er = s[3:0]; ec = (s > 15);
                    eo = ($signed(a) + $signed(b) > 7) || ($signed(a) + $signed(b) < -8); end
      3'b001: begin er = a - b; ec = (a < b);
                    eo = ($signed(a) - $signed(b) > 7) || ($signed(a) - $signed(b) < -8); end
      3'b010: er = a & b;
      3'b011: er = a | b;
      3'b100: er = a ^ b;
      3'b101: begin s = a + 1; er = s[3:0]; ec = (s > 15); eo = ($signed(a) == 7); end
      3'b110: begin er = a << 1; ec = a[3]; end
      3'b111: begin er = a >> 1; ec = a[0]; end
    endcase
  endfunction

  // Coverage: every opcode against the operand corners the scenario list names
  covergroup cg;
    cp_op: coverpoint op;
    cp_a:  coverpoint a { bins zero = {0}; bins max = {15}; bins sign = {8};
                          bins pos_max = {7}; bins other = default; }
    cp_c:  coverpoint carry;
    cp_v:  coverpoint ovf;
    x_op_a: cross cp_op, cp_a;
  endgroup
  cg cov = new();

  initial begin
    logic [3:0] er; logic ec, eo;
    void'($value$plusargs("BUG=%d", BUG));
    $display("Running with BUG=%0d", BUG);
    for (int o = 0; o < 8; o++)
      for (int i = 0; i < 16; i++)
        for (int j = 0; j < 16; j++) begin
          op = o; a = i; b = j;
          #1;
          model(a, b, op, er, ec, eo);
          cov.sample();
          checked++;
          if (r !== er || carry !== ec || ovf !== eo) begin
            errors++;
            if (errors <= 3)
              $display("MISMATCH op=%b a=%0d b=%0d : got r=%0d c=%b v=%b, expected r=%0d c=%b v=%b",
                       op, a, b, r, carry, ovf, er, ec, eo);
          end
        end
    $display("SUMMARY BUG=%0d checked=%0d errors=%0d coverage=%.2f%%",
             BUG, checked, errors, cov.get_coverage());
    $finish;
  end
endmodule

References

Read next

2 Comments

Comments are closed.