← Table of Contents · Page 309 of 868

REPLAY AND DEBUGGING

Part 4 of 10

A STEP-BY-STEP DEBUGGING ROUTINE A routine keeps debugging calm. First, reproduce the problem, using a replay if possible. Second, shrink it, removing steps and inputs until the smallest case that still fails remains. Third, form a guess about the cause, and write down what you would expect to see if the guess were true. Fourth, check the guess against the trace or a small experiment. Fifth, fix the cause and not just the symptom. Sixth, re-run the replay to confirm the fix. Seventh, record what you learned. Changing several things at once is the most common way to waste a day, so change one thing at a time. TURNING EVERY BUG INTO A TEST The best reward for a hard debugging session is a test that prevents the bug from returning. Save the shrunken failing case into the evaluation set, with the correct expected behavior. From then on, every change to the harness is checked against it automatically. Over months, the set becomes a record of every lesson the team has learned, and the agent becomes steadily harder to break.
Advertisement
Read Aloud:
0:00 / 0:00