IYIndo Yoon
·3 min read
Read in Korean (한국어 본문)

Cutting a Debugging Loop from 41 Minutes to 4 by Counting Round-Trips

Wall-clock debugging hours mostly measure waiting. Counting hypothesis round-trips — and instrumenting before editing — cut a 41-minute Friday night regression hunt down to 4 minutes.

Friday, 11:40 PM. Right before a release, CI turned red, and I was the only person on the commit log. Forty-one minutes later, the root cause turned out to be a single null guard I had deleted three hours earlier.

Here is the discipline that turned those 41-minute hunts into 4-minute fixes.

Crashes Are Cheap; Silent Failures Are Expensive

Bugs introduced during fast agent-assisted sessions rarely announce themselves with a clean segfault or stack trace. Crashes are polite. The expensive failures arrive quietly:

  • Unit tests stay green while production drops a field on edge inputs
  • Routes work locally and return 404 only behind static export or edge routing
  • Nothing errors at all — throughput simply degrades by 3x and nobody notices for a week

The third category costs the most because nobody classifies it as an incident until a user complains.

Count Round-Trips, Not Hours

Saying "I spent three hours debugging" tells you almost nothing; two hours and forty minutes of that was waiting on builds, CI queues, or blind retries. What actually cost money was the number of hypothesis round-trips.

I track four numbers when a bug resists the first fix:

MetricWhat It Measures
Round-tripsHow many edit-build-verify cycles ran per hypothesis
Time to first signalMinutes from noticing the symptom to reading the first decisive observation
Refuted hypothesesHow many mental models of the system proved false
Rollback distanceNumber of commits required to return to a known-good baseline

Round-trip count dominates all four. Cut round-trips and wall-clock time collapses automatically.

Three Rules That Shrink Round-Trips

  1. Instrument before you edit. Put an assertion, counter, or structured log at the exact boundary that proves or disproves your hypothesis before touching logic. Editing without instrumentation turns every cycle into a coin flip.
  2. Mutate one variable per run. Changing two things at once yields zero bits of information whether the test passes or fails.
  3. Keep rollback cost at one command. Small, atomic commits turn rollback into git checkout instead of a 20-minute surgical revert.

What to Hand the Agent — and What to Keep

Coding agents are tireless at instrumentation and iteration: running a reproduction loop ten times, bisecting commits, or scanning Computed Styles across viewports without losing patience. Hand all of that over.

Never hand over defining what counts as failure. Success criteria carry engineering accountability; delegate the oracle and an agent will cheerfully optimize the wrong metric—or delete the failing assertion—to turn the suite green.

The Four-Round Rule

Next time a production-only bug shows up:

  1. Write the reproduction condition in one sentence. If it takes two sentences, you haven't isolated the trigger yet.
  2. Add the probe that tests that sentence before writing a fix.
  3. Cross off one hypothesis per round-trip.
  4. If you pass round four without a root cause, stop guessing at lines and question the layer. Almost every 4+ round-trip bug lives one abstraction layer below where you started looking.