learning-it by example

Back to the video

Debug with AI: Give It a Traceback and a Minimal Repro

Eight rows crashed a report; a small shrink found the one row and a 5-line repro.

Video #173 ยท AI coding and productivity

Steps in the video

  1. 0:00 Eight rows crashed the report. One row and five lines reproduce it.
  2. 0:34 The idea
  3. 1:05 Setup
  4. 1:18 The bug
  5. 1:48 Run it for real
  6. 2:24 Shrink the input
  7. 2:58 The repro and the bundle
  8. 3:26 Run it
  9. 4:43 What this does not show
  10. 5:16 Mistakes to avoid
  11. 5:43 My take and next steps
  12. 6:14 Recap

Files

  • buggy.py (24 lines)
  • bundle.py (27 lines)
  • capture.py (24 lines)
  • run.py (24 lines)
  • shrink.py (32 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

No AI assistant is run, so this does not measure whether a bundle helps; the bug and data are made up, and the shrinker is a simple pass, not full delta debugging.

Sources

Learning IT by Example.