Log inStart free
LESSON 16.26 · 6 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

Testing an environment

Watch eight kinds of tests catch bugs planted in one warehouse environment.


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

Go Pro · $8.25/mo
EXPLAINER · 16.26 · TEST BAYTABLE 6 OF 6 PASS
01
Stage 1 of 6 · Table rows
Each row of a transition table sets a state and an action. The step must give the row's result: 6 of 6 rows pass.
Explain it simply

You see a table of cases picked by hand. Each row puts the robot in one state, sends one action and writes down what must happen. The floor shows the state of the row you point at. A row fails when the step gives something else.

A table of 6 rows with state, action, expected and got. 0 rows fail.

state and runsbattery and limitspassed testsfailed testslatent stock, cart, empty slots, tests not run
01234stationA2789C21112131415161718B1cart212223Rhandst 1 of 30 · battery 23bin nonestock A 2, B 1, C 2 · 5 itemsshown: row 1, before pickstateactionexpectedgotcell 6, shelf Apickhands ahands a✓cell 0, top edgeuponly t + 1only t + 1✓cell 19, by cartrightonly t + 1only t + 1✓cell 10, full handspickonly t + 1only t + 1✓cell 5, hands a, bpackhands none, bin a,bhands none, bin a,b✓cell 1waitonly t + 1only t + 1✓transitiontable6/6 passspacenot run yetfiniterewardnot run yetinvariantsnot run yetconservationnot run yetreproduciblenot run yetepisodeedgesnot run yetbadinputsnot run yetthe state under testtransition table: state, action, expected, gotthe test suite01234stationA2789C21112131415161718B1cart212223Rhandst 1 of 30 · battery 23bin nonestock A 2, B 1, C 2 · 5 itemsshown: row 1, before pickstateactionexpectedgotcell 6, shelf Apickhands ahands a✓cell 0, top edgeuponly t + 1only t + 1✓cell 19, by cartrightonly t + 1only t + 1✓cell 10, full handspickonly t + 1only t + 1✓cell 5, hands a, bpackhands none, bin a,bhands none, bin a,b✓cell 1waitonly t + 1only t + 1✓transitiontable6/6 passspacenot run yetfiniterewardnot run yetinvariantsnot run yetconservationnot run yetreproduciblenot run yetepisodeedgesnot run yetbadinputsnot run yetthe state under testtransition table: state, action, expected, gotthe test suite
Toy: the 16.C2 warehouse, 6 transition rows, a scripted solve and 1–100 seeded random runs
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
step(s,a)=?stable′\sy{g}{out}{\text{step}(s, a)} \overset{?}{=} \sy{e}{data}{s'_{\text{table}}}
row 1: got hands aexpected hands a\begin{gathered}\text{row 1: got } \sy{g}{out}{\text{hands a}} \\ \text{expected } \sy{e}{data}{\text{hands a}}\end{gathered}

The step from each row's state must give the table's next state.

Common mix-ups

MYTHMany random runs will find every bug.

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

Predict, then reveal
3 CHECKS · PRO
Q01With the pack bug and 10 random runs, which fails: invariants or conservation?

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

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 2 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.