A question about why an application is broken cannot be answered well. A question about why a specific function returns the wrong value for a specific input usually can. Getting from the first to the second is ten minutes of work and it changes everything downstream.
What is the fastest technique?
Bisecting. If it worked yesterday and not today, the cause is in between, and version control lets you check the halfway point. A few checks locate the exact change that introduced it.
This works without understanding the code at all, which is why it is the first thing to try.
What if there is no working version?
Reduce instead. Remove things until the problem disappears, then put back the last thing. Comment out half the function, use a smaller input, delete the parts not involved.
The end state is the smallest thing that still fails, which is what you actually want to ask about.
What does a minimal reproduction give you?
- A specific question. Rather than a general one.
- Elimination. Everything removed is proved innocent.
- Speed. Testing takes seconds rather than minutes.
- Frequently the answer. Reduction often reveals the cause on its own.
Why does reduction so often solve it?
Because removing context forces you to look at what remains. A substantial share of bugs are found during the process of preparing to ask about them, which is a genuine and underrated benefit.
What should you narrow first?
Whether it is your code at all. Trying the same operation with a trivial input, outside your application, establishes quickly whether the problem is in your logic or in something underneath.
How do you use AI during narrowing?
Do not diagnose this. Given this function and this symptom, what is the fastest sequence of checks to narrow down where the problem is? Give me three things to check in order, with what each result would tell me.
Asking for a plan rather than an answer keeps the investigation yours and produces better direction than guessing.
How long should this take?
Ten to fifteen minutes for most bugs. Beyond that you are usually stuck on something structural, and asking with what you have narrowed so far is more productive than continuing.
What should you record?
What you have ruled out. A list of things checked and eliminated is what stops you retesting the same hypothesis, and it is the most useful thing to include when you do ask.
What if narrowing makes it disappear?
That is information rather than a setback. A bug that vanishes when you remove something has told you the removed thing is involved, which is precisely what you were trying to establish.
The awkward version is when it disappears for no apparent reason, which usually means timing. Adding logging, removing code or running under a debugger all change how long things take, and a problem sensitive to that is a race condition wearing a disguise. Noticing that pattern early saves considerable time spent looking for something in the logic.
What is the payoff?
An answer about your actual problem rather than about a category of problem. That is the difference between a fix that works first time and three rounds of plausible suggestions, and it costs less time than the three rounds.