Skip to content

Lesson 02 – Writing Clear Bug Reports

Even with rigorous testing, defects slip through. A well-crafted bug report doesn’t just describe what went wrong—it accelerates how quickly it gets fixed. This lesson explains the anatomy of an effective report and how to write one that any developer can act on immediately.


1. Why Bug Reports Matter

Bug reports are more than complaints—they’re diagnostic tools. A good report:

  • Creates a record of defects for triage and planning.
  • Helps developers reproduce and investigate issues efficiently.
  • Connects QA, devs, and stakeholders around a shared understanding.

A vague report stalls progress. A clear one shortens the feedback loop and keeps projects moving.


2. Anatomy of a Bug Report

Every report should answer a single question: What exactly went wrong, and how can we see it happen again?

Here are the essential parts:

  1. Title – Concise summary of the issue.
  2. Environment – App version, OS, browser, or device info.
  3. Steps to Reproduce – Precise, numbered actions that trigger the bug.
  4. Expected Result – What should have happened.
  5. Actual Result – What actually happened (include error messages).
  6. Attachments – Screenshots, logs, or screen recordings.
  7. Severity/Priority – How badly the bug affects users or systems.

If the bug isn’t 100% reproducible, note any patterns (e.g., “fails on mobile only” or “seems related to slow connections”).


3. The Bug Lifecycle

flowchart LR
    Open["New Bug"] --> Triage{Triage}
    Triage -- valid --> Dev["Assigned to Dev"]
    Dev --> Fix["Code Fix"]
    Fix --> Review["Code Review"]
    Review --> QA["QA Verify"]
    QA -- pass --> Closed["Closed"]
    QA -- fail --> Dev
    Triage -- invalid --> Reject["Reject/Close"]

Most teams follow a similar workflow: Report → Triage → Fix → Review → Verify → Close.

A detailed bug report smooths each handoff.


4. Reporting Template

Use this Markdown structure to log consistent, useful bug reports:

**Title:** <Short summary of the issue>

**Environment:**
- App version: <e.g., 1.5.2>
- OS/Browser: <e.g., macOS 14, Safari 17>

**Steps to Reproduce:**
1. Go to...
2. Click...
3. Observe...

**Expected Result:** <Describe the intended behavior>

**Actual Result:** <Describe what actually happened, with errors if any>

**Attachments:**
- Screenshot: ![Screenshot](../media/sample.png)
- Logs: <link or filename>

**Severity/Priority:** <e.g., High / Medium / Low>

Adapt this to your team’s tracking tool (Jira, GitHub, etc.). The format matters less than covering the right details.


5. Sample Report

Here’s a filled-out example. Notice how the clear structure and specific steps make it easy to reproduce:

**Title:** "Login" button triggers 404 after password reset

**Environment:**
- App version: 2.3.1
- OS/Browser: Windows 11, Chrome 115

**Steps to Reproduce:**
1. Go to https://example.com/reset
2. Submit email to receive password reset link
3. Click the link in the email
4. Enter new password, click **Submit**
5. Click **Login** on the confirmation page

**Expected Result:** Redirects user to login page

**Actual Result:** Displays 404 “Page Not Found” error

**Attachments:**
- Screenshot: ![404 after reset](../media/02_bug_report_sample.png)
- Logs: `server_log_2023-05-01.txt`

**Severity/Priority:** Medium

6. Reporting Tips

Even small improvements make a big difference:

  • One issue per report – Avoid bundling unrelated bugs.
  • Use plain language – Skip jargon unless it's essential.
  • Include version numbers – Even minor releases can change behavior.
  • Crop screenshots – Show only what matters.
  • Reconfirm the bug – Test on the latest build before filing.

Every clear bug report saves someone else time—and earns goodwill from your team.


Additional Resources


Summary

Writing effective bug reports is a skill. Start by capturing exactly what happened, where, and how. Provide context. Add evidence. When done well, your report becomes part of the solution—not just a symptom.

The upcoming debugging lesson will show how to gather console traces and other evidence that make your reports even more actionable.

Takeaway: Precision saves time. When you make a bug easy to reproduce, you make it easier to fix.


Next up: Lesson 03 – Debugging JavaScript with the Browser Console