A failing randomize call has two symptoms: it returns 0, or it returns 1 with values the test did not want. Four root causes sit behind those symptoms, and each needs a different tool.
Symptom | Root cause | First tool |
|---|---|---|
Returns 0 | Hard contradiction: the active constraints plus state values have no solution | Binary search over constraint blocks |
Returns 1, field never changes | Silent skip: null handle, stuck rand_mode, or field never rand | Handle and mode audit |
Returns 1, values skewed | Wrong distribution: implication skew, eaten soft default, clipped range | Histogram over many calls |
Fails only on some seeds | Seed and stability problem, not a constraint problem | Seed capture and replay |
Lesson | What it covers |
|---|---|
The four modes, the triage flowchart, and the solver refresher. | |
Block binary search, null checks, solver dumps, and minimal repros. | |
Histograms, implication counting, solve-before, and silent discards. | |
Seed replay, the silent trio, loud wrappers, and the ten-step procedure. |
No. Reproduction is orthogonal to the other modes. Capture the seed, replay the exact test, seed, and build triple, and confirm a bit-identical failure before touching any constraint.