Log inStart free
LESSON 16.27 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Fuzzing and failure injection

Watch random, hostile and failing inputs find four planted bugs in a toy environment.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 16.27 · TEST HARNESSFOUND 1 OF 8 RUNS · 100 STEPS EACH
01
Stage 1 of 5 · Random actions
8 fuzz runs send up to 100 random actions and check the invariants. Only run 8 breaks one, at step 30.
Explain it simply

Each row is one test run with its own seed. A random agent presses left, right, pick or drop, and the teal line shows the robot's cell. After every step, the harness checks three rules at the top. Each cross is the robot picking a second item while it already carries one.

1 of 8 random runs break an invariant within 100 steps.

env state, actionslimitsbroken checks, faultschecks that pass
env under test (buggy) · run 8, after step 30012345dropshelfrobot0 ≤ pos ≤ 5pos 5okcarried ≤ 1carried 2brokenshelf + carried + delivered = 31 + 2 + 0 = 3ok8 fuzz runs · up to 100 random steps eachrun 1okrun 2okrun 3okrun 4okrun 5okrun 6okrun 7okrun 8step 300100 stepsenv under test (buggy) · run 8, after step 30012345dropshelfrobot0 ≤ pos ≤ 5pos 5okcarried ≤ 1carried 2brokenshelf + carried + delivered = 31 + 2 + 0 = 3ok8 fuzz runs · up to 100 random steps eachrun 1okrun 2okrun 3okrun 4okrun 5okrun 6okrun 7okrun 8step 300100 steps
Toy: a 6-cell warehouse corridor, 3 items, 40-step episodes, 8 seeded fuzz runs
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
F=#{runs that fail within B steps}\sy{f}{out}{F} = \#\{\text{runs that fail within } \sy{b}{param}{B} \text{ steps}\}
F=1 of 8,  B=100F = 1 \text{ of } 8,\; B = 100

F counts the runs that break a rule within B steps.

Common mix-ups

MYTHIf random fuzzing finds nothing, the env has no bugs.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01In the buggy env, with 400 random steps per run, how many of the 8 runs break an invariant?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.