Imagine someone tells you: “The login is broken.”
- You did not write the login system.
- You did not make the last change.
- You have never worked in this part of the application.
Now you need to investigate.
- Where do you start?
- Not with blame.
- Not with a guess.
- Start with evidence.
- Can you reproduce the problem?
- Does it happen for every user?
- What changed recently?
- What does the application log?
- Where does the request fail?
- Is the problem in the client, API, database, authentication provider or configuration?
Debugging is often detective work.
- You follow clues.
- You narrow the possibilities.
- You test assumptions.
And you document what you discover.
Sometimes you will find that the code is not the problem at all.
- The environment may be different.
- The data may be unexpected.
- A dependency may have changed.
- A configuration value may be wrong.
Learning to debug unfamiliar problems is one of the clearest examples of why professional software work is more than writing new code.