Debugging starts with a mismatch between expected and observed behavior. The purpose is to discover why it happens, not merely to make the visible symptom disappear.
A worked investigation
Suppose a fictional inventory page shows zero available items, although a known record has three. The report alone does not tell us whether the problem is in storage, the server, or the display. A careful investigation could proceed as follows:
- Record the expected value, observed value, conditions, and a safe way to reproduce the problem. Use a disposable test record rather than altering live inventory.
- List plausible causes: the server returned zero, the response was transformed incorrectly, or the display read the wrong field. These are hypotheses, not findings.
- Inspect a sanitized response and the rendering path. If the response contains
available: 3but the page readsquantity, that evidence supports a field mismatch. It does not rule out every other defect. - Add a focused regression test for the intended display; where feasible, confirm that it fails for the observed mismatch before the fix. Change the field mapping, then rerun the focused and relevant broader checks.
- Remove temporary diagnostic logging if it is no longer needed, and report remaining uncertainty.
This is an illustrative trace, not an account of a real run. If the response does not contain the expected value, the next investigation belongs earlier in the data path. If reproduction fails, preserve that uncertainty and seek more information rather than claiming a cause.
Ask for the observation behind the conclusion
Useful evidence may include a failing test, a sanitized log, an error trace, or a minimal reproduction. Remove secrets and personal data before sharing; reproduce in a safe environment when possible. Temporary instrumentation can have side effects or expose sensitive data, so agree on its scope and cleanup. An agent’s proposed fix is a hypothesis until the evidence and subsequent checks support it. If no safe reproduction is possible, stop and describe what is missing.