beginner · 20 minute study
Turn a complaint into a reproducible defect
A vague bug report invites a vague fix. The fastest useful first step is to make expected behavior, actual behavior and reproduction steps precise.
Useful preparation · 1 prerequisite
Use this as a map, not a lock. If these ideas are familiar, continue.
- Turn a failure into a controlled experiment — Learn to diagnose a defect from evidence instead of changing code until the warning disappears.
First, build a mental model
A defect is a difference between an expected contract and an observation. A reproduction is a small experiment that makes that difference appear again.
- Record the symptom separately from your explanation. 'Total is 6 after two clicks' is an observation; 'React is broken' is an untested hypothesis.
- Capture the smallest relevant input, initial state, action sequence and environment. Include viewport or input device when they affect the failure.
- Reduce one dimension at a time while retaining the symptom. Removing unrelated network, styling or records makes competing explanations easier to separate.
- Use breakpoints, stack traces and inspected values to locate the first divergence. Logging everything can bury evidence and expose sensitive data.
function labelCount(count) {
return count + 1;
}
console.log(labelCount(5)); // 6
console.log(labelCount('5')); // '51'
// Observation: a string input changes the operation.- Observe
The numeric input and string input look similar in a form but produce different outputs.
- Reduce
The failure survives without React, a database or CSS: one function and one input are enough.
- Locate
The first divergence is the input type. Addition and string concatenation are different operations.
Production thinking
Take this beyond the example.
A useful issue contains a repeatable scenario and its consequence. For private systems, use synthetic fixtures and redact sensitive values rather than uploading broad logs.
Sources and further reading
Your evidence
unseen is a local learning signal, not a credential or proof of production competence.
Explain the mental model, then explicitly acknowledge it. Opening a page is not evidence.
Supported retries can complete this lesson. Independent evidence and delayed review determine the skill stage.
Next lesson · Make one hypothesis face a counterexample →