Debugging mindset8 min read

Five Debugging Habits That Separate Seniors from Juniors

It's not tools. It's not years of experience. It's five repeatable habits that senior engineers do reflexively and juniors haven't built yet.

debuggingcareerengineering-habitson-call

I have pair-debugged with hundreds of engineers over a decade. Junior, senior, staff, principal. The pattern that separates the fast fixers from the hours-long rabbit holes is never the tool. It is always the habit.

These five habits are mundane on paper. In practice, under pressure at 2am with an incident bridge full of people, they are the difference between a 20-minute fix and a four-hour slog.

1. Read the full error before touching anything

The most common waste I see: an engineer glances at the first line of a stack trace, recognizes a file name they wrote, and immediately opens that file. They have already assumed the answer. The error often tells you exactly what is wrong — in line two, or three, or in the cause chain below the surface exception.

Force yourself to read every line of the error before you touch the code. If it is a stack trace, find the lowest frame in your own code. If it is a log message, find the original emit site, not the propagation chain.

warning

The single most common debugging waste is opening the wrong file because you read the first line of the stack trace and stopped.

2. Change one variable at a time

This sounds so obvious that experienced engineers often skip it under pressure. 'I'll just try these three fixes together to save time.' What you actually lose is the ability to know what worked. Worse: two of the three 'fixes' might cancel each other out, and you ship code you don't understand.

One change. Observe. Record. Then the next change. This is not slow — it is how you avoid spending three hours on a bug that a single bisected change would have found in twelve minutes.

73%

of senior engineers explicitly name 'change one thing at a time' as their most-used debugging rule (Buglyst internal survey, 2024)

3. Distinguish 'I can reproduce it' from 'I understand it'

These are not the same state. You can reproduce a bug without understanding why it happens. Reproduction is table stakes — the minimum to work on a bug. Understanding is the state you need to write a fix that actually holds.

Ask yourself: can I predict what will happen if I change input X to value Y? If the answer is no, you are still in 'reproduction' mode. Do not start writing the fix.

4. Write the hypothesis before you test it

Typing before thinking is the root cause of most debugging sessions that feel like wandering. Write one sentence: 'I believe the bug is caused by X, which I will confirm by Y.' This forces you to have a model before you have an experiment. It also creates a record — if the hypothesis is wrong, you know what to revise.

Three wrong hypotheses that you wrote down and disproved are worth more than ten instinctive trial-and-error changes. You're building a model of the system, not spinning a slot machine.

Three wrong hypotheses that you wrote down are worth ten instinctive trial-and-error changes.

5. Fix the root cause, not the symptom

A try/catch that swallows the error is not a fix. A retry loop that papers over an underlying timeout is not a fix. These are deferments — you are not reducing the probability of the bug, you are reducing the probability of noticing it, and you are guaranteeing it will reappear in a form you did not expect.

Root-cause analysis is not bureaucratic paperwork. It is the question 'what would have to be true for this to never happen again?' Ask it every time, even for small bugs. The habit builds faster diagnostic instincts over time.

lightbulb

After every bug fix, add a one-line comment or commit message note that names the root cause — not what you changed, but why the bug existed. Future you will thank present you.

Frequently asked questions

How do I get better at debugging faster?

Practice on real bugs with a time box. Treat every debugging session as a skill to debrief — write a one-sentence post-mortem about what you assumed wrong.

Should I always read logs before debugging?

Yes. Every time. The log tells you what actually happened; your memory of what the code should do tells you what you expected. Those two things are usually different.

What is the single best debugging habit?

Change one thing at a time. Every other habit supports this one. When you change two things simultaneously you lose the ability to know which one fixed it — or made it worse.