QA AND TEST AUTOMATION · PART 1 · MANUAL TESTING, PROPERLY · PRACTICE · 16 OF 112

How to Write a Bug Report, and the Defect Life Cycle

How to write a bug report a developer can act on in minutes: a precise title, environment, minimal steps, expected versus actual with the requirement id, evidence from the UI, the API and the database, then severity and priority. Plus the defect life cycle from new to closed, including rejected, duplicate, deferred and reopened, on a real ShopRung stock bug.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 67
  63. 68
  64. 69
  65. 70
  66. 71
  67. 72
  68. 73
  69. 74
  70. 75
  71. 76
  72. 77
  73. 78
  74. 79
  75. 80
  76. 81
  77. 82
  78. 83
  79. 84
  80. 85
  81. 86
  82. 87
  83. 88
  84. 89
  85. 90
  86. 91
  87. 92
  88. 93
  89. 94
  90. 95
  91. 96
  92. 97
  93. 98
  94. 99
  95. 100
  96. 101
  97. 102
  98. 103
  99. 104
  100. 105
  101. 106
  102. 107
  103. 108
  104. 109
  105. 110
  106. 111
  107. 112
1 / 14

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Precise title
  • minimal steps
  • expected from a requirement
  • evidence
  • new → fixed → verified → closed

Notes

The problem

Here is a report that will bounce. Title: checkout broken. Description: stock is wrong after buying stuff, please fix as soon as possible. The developer has to ask which product, which user, which build, and wrong how? After a day of back and forth, they cannot reproduce it, and the ticket is closed. The bug is real, but the report failed. A good report answers every question before anyone asks it.

A report that bounces
  • title: checkout broken
  • description: stock is wrong
  • after buying stuff, please fix
  • ASAP!!!
  • developer: which product? which user? which build? wrong how? → cannot reproduce → closed

The idea

A bug report has a fixed set of parts. A clear title. The environment: build, browser, operating system, test data and user. Preconditions. Minimal steps to reproduce. The expected result, with the requirement that says so. The actual result. Evidence: screenshots, a short video, the request and response, a database query. Severity and priority. And how often it reproduces: always, or three times out of five. One bug per report, always.

A bug report has
  • id and title
  • environment: build, browser, OS, data, user
  • preconditions
  • steps to reproduce (minimal)
  • expected result + requirement
  • actual result
  • evidence: screenshot, video, request, response, query
  • severity, priority, reporter
  • reproducible: always / 3 of 5

The title

The title is what people read in a list of two hundred tickets, so it must stand alone. Checkout broken and stock bug say nothing. Strong titles say what goes wrong, where, and under what condition. Placing an order does not reduce product stock. Save ten refused at a subtotal of exactly fifty dollars. A developer reading the strong title already has a guess where to look, and a manager can judge the impact without opening it.

Weak vs strong titles
  • weak checkout broken
  • weak stock bug
  • strong Placing an order does not reduce product stock (ORD-2)
  • strong SAVE10 refused at a subtotal of exactly $50.00
  • what goes wrong + where + under what condition

Minimal steps

Steps should be minimal. Start from everything you did, then cut steps until removing one more would make the bug disappear. Here: log in as Alice, note that the Bug Hunter's Diary has three in stock, add one to the cart, place the order, open the product again. Expected: two in stock, because rule order two says placing an order reduces stock. Actual: still three. Five steps, exact data, one expected and one actual result.

Steps to reproduce
  • pre: bug switch stock-not-reduced on; reset
  • 1. log in as alice
  • 2. note stock of Bug Hunter's Diary: 3 in stock
  • 3. add 1 to the cart
  • 4. Place order → order PLACED
  • 5. open the product again
  • expected: 2 in stock (ORD-2)
  • actual: 3 in stock

Evidence

Evidence turns your word into proof. Screenshots of the product page before and after. From the browser's network tab, the request that placed the order and its status, two hundred and one created. From the SQL console, a query for the stock of that product before and after: three and three. Now the developer knows it is the server, not a stale page in the browser. The next two episodes teach exactly these tools: SQL and DevTools.

Evidence that convinces
  • screenshot: product page before and after network tab: POST /api/orders → 201 Created
  • SQL console: SELECT stock FROM products WHERE sku = 'BK-103'; before 3, after 3
  • proves it is the server, not a stale page

Expected vs actual

The expected result should come from a requirement, quoted with its id, not from your opinion. That ends arguments before they start. If no requirement covers the case, say so honestly: expected, my assumption, and tag the product owner. Keep expected and actual on separate lines, with the same level of detail, so the difference jumps out. Stock should go from three to two. It stays at three.

Expected vs actual
  • expected: stock goes from 3 to 2 (ORD-2: placing an order reduces each product's stock)
  • actual: stock stays at 3
  • no requirement? write "expected (my assumption):" and ask the product owner

Tone

Tone matters. Report facts, not blame. Never write you broke stock again, obviously wrong, or anything in capitals with exclamation marks. Write what you did, what you saw and what you expected. Then add anything that narrows the cause: does it happen with every product, only with coupons, only for one user? A developer who trusts your reports fixes them first. Testers and developers are on the same side.

Facts, not blame
  • avoid: "you broke stock again"
  • avoid: "obviously wrong"
  • avoid: CAPS and !!!
  • write: what you did, what you saw, what you expected
  • add: anything that narrows it (only with one product? only after a coupon?)

Life cycle

Every defect lives through a life cycle, which is just a state machine like the one in the state transition episode. New, assigned, in progress, fixed, ready for test, verified, closed. At triage it can leave the main path: rejected if it is not a bug, duplicate if it was already filed, deferred if it will be fixed later, cannot reproduce if the developer could not see it. And if your re test fails, it is reopened.

Defect life cycle
NEW → ASSIGNED → IN PROGRESS
  → FIXED → READY FOR TEST
  → VERIFIED → CLOSED

side exits from triage:
  REJECTED  (not a bug)
  DUPLICATE (already filed)
  DEFERRED  (fix later)
  CANNOT REPRODUCE
failed re-test → REOPENED

Verify the fix

When the bug comes back marked fixed, read the fix note: which build, and what changed. Re run your exact steps: stock now goes from three to two. Then check around the fix, because fixes often break neighbours. Does cancelling still put the stock back, which is order six? Does it work with two products and with a quantity of three? If everything passes, mark it verified. If not, reopen it with fresh evidence, not just still broken.

When it comes back FIXED
  1. read the fix note: which build, what changed
  2. re-run your exact steps → stock 3 → 2
  3. check around it: cancel puts stock back (ORD-6), two products, quantity 3
  4. pass → VERIFIED, else REOPENED with new evidence

Triage

New bugs are reviewed in triage, often a short meeting with a tester, a developer lead and the product owner. For each bug: is it valid, is it a duplicate, how bad is it, how soon must it be fixed, who owns it, and for which release. Your report is judged in about thirty seconds, from the title and the first lines. That is why the title and the evidence matter so much. Severity and priority get their own episode next.

Bug triage meeting
  • who: QA, dev lead, product
  • for each new bug: valid? duplicate? severity: how bad? priority: how soon? owner and target release
  • your report is judged here
  • in about 30 seconds

Common mistakes

Reports that waste time. Several bugs in one report, so it can never be closed cleanly. No build number or environment. Steps written from memory and never tried again. It does not work as the actual result. No evidence. An opinion instead of a requirement as the expected result. Not searching for an existing report first. And marking a bug verified without re running the steps on the new build.

Avoid these
  • several bugs in one report
  • no build or environment
  • steps from memory, untried
  • "it does not work"
  • no evidence
  • opinion as expected result
  • not searching for duplicates
  • closing your own bug without re-testing

Say it like this

Interviewers ask what makes a good bug report, and sometimes ask you to write one on the spot. Say: a specific title, the environment and build, minimal reproducible steps with exact data, the expected result from the requirement versus the actual result, evidence from the screen, the network and the database, and severity and priority. One bug per report, facts not blame. Then walk through the defect life cycle if asked.

In the interview
  • "A specific title, the environment and build, minimal reproducible steps
  • with exact data, expected
  • from the requirement versus
  • actual, evidence from the UI, network and database, and severity and priority.
  • One bug per report, facts
  • not blame."

Interview questions

Q1What are the parts of a good bug report?

A specific title, environment and build, preconditions, minimal steps with exact data, expected result (with the requirement) and actual result, evidence, severity, priority and reproducibility.

Q2What is the defect life cycle?

The states a defect moves through: new, assigned, in progress, fixed, ready for test, verified, closed, with side states such as rejected, duplicate, deferred, cannot reproduce and reopened.

Q3What do you do when a developer says "cannot reproduce"?

Re-run the steps on the same build and environment, check data and user differences, add evidence (video, network log, database state), and if needed reproduce it together.

Q4What is the difference between rejected and deferred?

Rejected means it is not considered a bug (works as designed). Deferred means it is a valid bug that will be fixed in a later release.

Q5How do you verify a fix?

Re-run the exact steps on the build with the fix, then test around it for side effects (regression), and mark it verified or reopen it with new evidence.

Q6Why include the requirement id in a bug report?

It shows the expected result comes from an agreed rule, not an opinion, which speeds up triage and avoids "works as designed" arguments.

Q7What evidence would you attach to a backend bug found through the UI?

Screenshots, the request and response from the network tab (status, body), relevant logs, and database queries showing the wrong data.

Q8Write a title for a bug where SAVE10 fails at $50.00.

"SAVE10 is refused at a subtotal of exactly $50.00 (PRICE-3 says $50.00 or more)".