DEV Community

Cover image for The bisect: the debugging method AIs haven't learned yet
Etienne Lescot
Etienne Lescot

Posted on

The bisect: the debugging method AIs haven't learned yet

Had a weird bug yesterday. Instead of asking an AI to list 15 possible causes, I did a bisect: cut the code in half, tested, eliminated the working half, repeated. Found it in 5 minutes.

Bisecting (binary search debugging) is O(log n) instead of O(n). It's what experienced devs do instinctively: git bisect for regressions, disable half the CSS rules, cut a pipeline in two, simplify an API request by half.

Current LLMs do the opposite: analyze everything, propose 10 hypotheses, explain each in detail. Useful for understanding, inefficient for isolating.

Why? They're trained on code and explanations, not interactive debugging traces. Their pattern is "exhaustive analysis" instead of "hypothesis → minimal test → elimination → iteration".

For an AI to actually help debug, it should propose binary tests and iterate based on results. Training datasets should include git bisect sessions and divide & conquer patterns applied to code.

Until then, your dev brain is still more efficient at methodically isolating problems.

Top comments (0)