Logging a Defect/Bug


How to Log a Bug (Defect) with a Detailed Description

Bugs (or defects) are a normal part of software development, but identifying and fixing them quickly is crucial for smooth user experiences. To help the development team fix bugs as fast as possible, you need to log a detailed bug report. 




But what exactly should you include in your report? Let’s break it down step-by-step.

Why a Good Bug Report Matters

A well-written bug report helps developers understand exactly what went wrong and how to fix it. Without clear details, it can take much longer to identify and fix the issue. A good report will:

  • Help the team reproduce the bug (recreate the problem so they can understand it).
  • Make it easier to fix the bug (give them the information they need to find the cause).
  • Speed up the process of resolving the issue.



So, how do you write a good bug report? Here’s what you need to include.

Key Components of a Good Bug Report

1. Bug Title/Summary

Start with a clear and simple title that describes the issue. This is the first thing the development team will see, so it should help them understand what the problem is at a glance.

Example:

  • Good: "Login page gives an error when I enter the wrong username."
  • Bad: "Login issue."

A specific title makes it easier for the team to prioritize the bug and know what to expect.

2. Environment Details

This section tells the team where you encountered the bug. Different devices, browsers, or versions of the software can sometimes cause bugs to behave differently. Be as specific as possible.

Things to include:

  • Device (e.g., laptop, phone, tablet)
  • Operating System (e.g., Windows 10, macOS, iPhone)
  • Browser (e.g., Chrome, Safari, Firefox) if it’s a web-based issue
  • App Version (e.g., Version 2.1.4 of the app)

For example, the bug might only happen in a certain browser or on a specific device. Giving this info helps the team focus on the right setup.

3. Steps to Reproduce

This is one of the most important sections. You’ll need to describe exactly how the team can recreate the bug—this is called "reproducing" the bug. The clearer you are, the easier it will be for them to see the same problem.

Here’s how to do it:

  • Write clear, step-by-step instructions on what to do to trigger the bug.
  • Avoid assumptions—if you’re not sure how something works, describe it as best as you can.

Example:

  1. Open the app on your laptop.
  2. Go to the "Login" page.
  3. Type in an incorrect username, like “user123.”
  4. Press the "Login" button.

4. Expected vs. Actual Results

In this section, you describe what you expected to happen vs. what actually happened.

  • Expected Result: This is what should happen if everything works as it should.
  • Actual Result: This is what really happens when you try it.

Example:

  • Expected Result: You should see a message like, “Invalid username” and stay on the login page.
  • Actual Result: The app crashes, and you see an error message instead of the login form.

By explaining the difference, you make it clear to the team what went wrong.

5. Screenshots and/or Screen Recording

If possible, add pictures or videos showing what happened. A screenshot of the error message or a video showing the bug in action can help the team understand the problem much faster.

If you can, take a screenshot of the page where the error appears or record a short video of the bug happening.

6. Error Logs (If Available)

Sometimes, the bug might produce a message in the background that can help explain what went wrong. If you see any error messages, include them in the report.

For example, a browser might show a “JavaScript error” message in the console when something breaks. Developers can use these logs to pinpoint the issue more quickly.

7. Priority and Severity

Priority and severity help the team understand how urgent the bug is.

  • Priority refers to how quickly the bug needs to be fixed. For example:
    • Low Priority: Not urgent fix when you have time.
    • High Priority: Needs fixing soon because it’s affecting many users.
  • Severity refers to how much the bug affects the software:
    • Low Severity: A minor issue that doesn’t stop users from using the app.
    • Critical Severity: A major issue, like a crash, that stops users from using the app entirely.

Example:

  • Priority: High
  • Severity: Critical

8. Additional Information

This is where you can add any extra details that might help. For example:

  • Was the bug working before? If the bug appeared after an update, mention that.
  • Is the bug intermittent? Does the bug happen every time, or is it random?
  • Have you tried anything to fix it? For example, did restarting the app help?

9. Assigned To (If Applicable)

In some cases, you might need to assign the bug to a developer or team. This ensures the right person is aware of the issue and can start working on it.


Example of a Full Bug Report 

Title: Items disappear from the shopping cart when I proceed to checkout.

Environment:

  • Device: Desktop computer
  • OS: Windows 10
  • Browser: Chrome 95.0
  • App Version: v3.0.1 (Online Store)

Steps to Reproduce:

  1. Open the online store in your browser.
  2. Browse and add items to your shopping cart (e.g., add a "T-shirt" and "Shoes").
  3. Click on the shopping cart icon at the top of the page to view your cart.
  4. Press the “Proceed to Checkout” button.
  5. Notice that the items are no longer in the cart.

Expected Result:

  • The items added to the shopping cart (like the T-shirt and Shoes) should still appear when you go to checkout.

Actual Result:

  • The shopping cart is empty when I proceed to checkout, even though I added items earlier.

Screenshots:

Priority: High
Severity: Major (this issue prevents users from completing their purchases)

Additional Information:

  • This issue has been happening since the website updated to version 3.0.1 last week.
  • I tried refreshing the page, but the problem still occurs.
  • The bug happens every time I try to checkout, no matter which items I add to the cart.
  • I have tested this on other browsers, but the issue seems to be specific to Chrome.


Comments

Popular posts from this blog

Client and Server

Use Case, Test Case and Test Scenario