Skip to content
engineering workbench.by StudyPort Academy
Learning path
Intermediate18 minLESSON 04 / 6

Debugging with AI: the structured bug report

01

Understand the idea

"It's broken, fix it" gets inventive help. A report with symptoms, expected versus actual behavior, and repro steps gets usable help.

The cost of a vague report

Vague reports produce vague fixes. The model fills gaps with common failure stories for that feature area. Sometimes it invents a plausible that fits the topic and misses the race you actually have. Structure is how you stop that invention.

AI Lab · bug report

Turn "broken sometimes" into something an AI can use

Vague report

checkout is broken sometimes. can you fix it?

You know a bit more than that prompt says: this is a React cart on /checkout. Paying with a saved card sometimes shows "Payment failed" even though Stripe's dashboard shows the charge succeeded. It seems worse on slow hotel Wi-Fi. The cart stores line items in localStorage under wb_cart. The failing function is confirmCheckout in lib/checkout.ts, which calls /api/checkout then clears the cart.

A skeleton that travels well

Use the same spine every time: symptom, expected versus actual, repro steps, relevant context, and frequency when the bug is intermittent. That skeleton is not bureaucracy. It is the minimum packet that lets another engineer - human or model - aim.

Vague line versus structured field
FieldVagueStructured
Symptomcheckout brokenPayment failed toast on /checkout
ExpectedworksRedirect to /orders after success
Actualdoesn'tToast fires; Stripe shows succeeded
ReprosometimesFast 3G; pay saved card; 1 in 5

Repro steps are the leverage

Ordered steps beat theories. Include environment notes that matter: throttled network, a specific browser, a particular cart size. If you cannot reproduce on demand yet, say the closest pattern you have and how often it appears. "Sometimes" without numbers is fog.

Context without a repo dump

Name the failing function, route, storage key, or dashboard evidence. Paste the smallest snippet that shows the suspicious sequence. Your should point, not flood.

Feed results back into the report

When a suggested experiment fails, update the report with what you learned. Debugging with AI is iterative. Each loop should shrink the hypothesis space, not restart from "it's broken."

02

Mental model

FOLLOW THE VALUE

symptom
visible failure
shared target

Name what the user saw.

01 / 03Trace the transformation

03

Live example

The logs name the spine of a bug report an assistant can actually use.

Opening editor…
LIVE PREVIEW
Console 0

Your console output appears here.

Saved on this deviceJavaScript · ES2022
04

Guided challenge

Ask for repro, not guesses

The fourth log says guesses. Change it to repro-steps.

Opening editor…
LIVE PREVIEW
Console 0

Your console output appears here.

Saved on this deviceJavaScript · ES2022

EXPECTED CONSOLE OUTPUT

Payment failed toast on /checkout
redirect to /orders after succeeded charge
toast + cart kept; Stripe shows succeeded
repro-steps
structured

Hints 0/2

    Use all hints or make 3 failed runs (0/3).

    05

    Free sandbox

    Make a variation, test an assumption, or break the example on purpose. This draft is saved separately.

    Opening editor…
    LIVE PREVIEW
    Console 0

    Your console output appears here.

    Saved on this deviceJavaScript · ES2022
    06

    Quiz

    A quick check for understanding. Retry as often as you like; your learning path stays open.

    01What belongs in a structured bug report for AI help?
    02Why is "broken sometimes" a weak prompt?

    Ready to call this one understood?

    Mark this lesson complete to earn 150 XP. You can always revisit it.

    Sign in to save progress
    Next lesson