Reproduce Before You Fix
Meera sends a message: "Kitty says I've paid way more than I have." The fastest-looking move is to paste that into the assistant with "fix the balances". It will change something plausible, and you will have no way to tell whether it fixed Meera's problem, a different problem, or nothing. Debugging starts before any fix.
The rule
No fix until you can make the bug happen on purpose.
A bug you can trigger whenever you like is half solved. To get there, pin down four things:
- Steps. Exactly what was done, in order.
- Expected. What should have happened, according to the spec.
- Actual. What happened instead, with real numbers.
- Smallest case. The shortest set of steps that still shows the bug. Strip away every expense, flatmate and click that does not matter.
Then catch the bug in a test. A failing test is the bug held still: the assistant can run it, you can see when it turns green, and it stays in the suite to stop the bug returning.
def test_editing_an_expense_replaces_it():
flat = make_flat(["Asha", "Ravi", "Meera"])
expense = add_expense(flat, paid_by="Meera", paise=30000, note="groceries")
edit_expense(flat, expense, paise=33000)
assert total_paid(flat, "Meera") == 33000Now your prompt can be precise: "This test fails: Meera's total is 63000 instead of 33000. Make it pass without editing the test."
The shortcut
Before any fix prompt, write four lines: steps, expected, actual, smallest. If you cannot fill one of them, you are not ready to ask for a fix. Ask questions or experiment instead.
Steps
You ask Meera what she did. She logged ₹300 of groceries, then noticed the receipt said ₹330 and edited the expense.
The trap is fixing the story instead of the bug. "Balance is wrong" could mean a dozen different faults. Reproducing it turns a story into one specific, checkable fact.
Drills
Answer fast — trust the rule.
Meera says "my balance is wrong". What is your first move?
Why shrink a bug down to its smallest case?
What does turning the bug into a failing test give you?
After one edit from ₹300 to ₹330, Meera's total shows ₹630. What is the most likely cause to check first?
Remember
- Rule: no fix until you can make the bug happen on purpose.
- Shortcut: steps, expected, actual, smallest, then a failing test.
- Trap: sending the story ("it's wrong") instead of the reproduced fact.
