A coverpoint names what is watched. Its bins decide which sampled values count as which scenario, which values are violations, and which values are out of scope.
Bin kind | It says | Coverage goal |
|---|---|---|
| This scenario must happen | In |
| Each of these must happen | In, one bin per value |
| This sequence must happen | In |
| Anything else, for bookkeeping | Out |
| Out of scope, do not count | Removed |
| Must never happen | Removed; a hit is a run-time error |
| Values matching the pattern | In |
| Values where the expression holds | In |
Coverage is hit goal bins divided by total goal bins.
Lesson | What it covers |
|---|---|
The 64-bucket trap, named value bins, and one bin versus many. | |
Sequences, repetition operators, and the FSM arc recipe. | |
Illegal and ignore bins, wildcard patterns, and with filters. | |
Intent-driven bins, explosion control, and a worked redesign. |
m[] = {[0:7]}, with ignore_bins {6} and illegal_bins {7}. Four goal bins are hit. What is the coverage?Four of six, 66.7%. Each excluded value was the only value of its bin, so both bins empty out and leave the goal: the denominator is 6, not 8. An exclusion removes a bin only when it empties it.