Defects and the defect report
In short: A defect report is a letter to someone who did not see the bug. They must be able to repeat it the first time: short steps, the expected result from the rule and the actual result from the system. Severity says how much harm the defect does, priority how soon to fix it; both are judgement and often differ.
Problem
"Delivery does not work"
The tester writes in the defect tracker: "Delivery does not work. Urgent!" The developer tries a cart of 30 € and sees 4.90 €. Tries 70 € and sees 0.00 €. All fine. They close the report as "cannot reproduce".
A week later a customer complains that they paid for delivery on an order of exactly 50.00 €. The tester saw it first. But their report gave neither the amount, nor what they expected, nor what they got.
The idea
A report is a letter to someone who was not there
A defect report has one job: someone else repeats the bug the first time and understands why it is a bug. So a good report has:
- a title that says the bug: "Delivery is 4.90 € for an order of exactly 50.00 €", not "Delivery does not work";
- steps: the shortest path to the bug, with the exact data. Not one step too many;
- expected: what the rule says. Free delivery;
- actual: what the system did. 4.90 €;
- environment: version, browser, device, when they matter;
- severity and priority (the next cards);
- a link to the requirement and to the test case that caught it.
One thing a report does not contain: who is to blame. The defect is in the product, not in the person.
More precisely, if you are curious
CTFL v4.0.1, section 5.5, gives the typical content of a report: a unique identifier, a title with a short summary, the date, author and organisation, the test object and environment, the context (test case, activity, technique), a description of the failure to enable reproduction and resolution, with steps, logs and screenshots, the expected and actual results, severity, priority, status and references. The syllabus also gives its objectives: information for the fix, a way to track the quality of the product, and ideas for improving the process.
The idea
The life of a defect
A report does not end when it is written. It goes through several states:
- New: the tester writes it.
- Open: at triage the team accepts it as a defect and gives it a priority.
- In progress: the developer finds the cause and fixes it.
- Fixed: the fix is in the version for testing.
- Verified: the confirmation test passes, and so do the regression tests around it.
- Closed.
The detours matter just as much. Rejected: not a defect, the system does what the rule says (then maybe the rule is wrong, and that is a question for the analyst). Duplicate: it is already reported. Deferred: it is a defect, but it will not be fixed now. Reopened: the confirmation test fails again.
More precisely, if you are curious
The names of the states differ between teams and tools (Jira, Azure DevOps, GitHub Issues). CTFL does not prescribe particular names: what matters is that the defect process is agreed, and everyone knows what each state means and who changes it.
Try it
Order the path
Order the states of the defect from the report to closing.
Verified: the confirmation test passes, and so do the regression testsClosedIn progress: the developer finds the cause and fixes itOpen: the triage accepts it as a defect and gives it a priorityNew: the tester writes the reportFixed: the fix is in the version for testing
The priority is given at triage, before anyone starts work. "Verified" means a confirmation test and regression, not the developer's word.
The idea
Severity and priority are not the same
The two get mixed up all the time:
- Severity is how much harm the defect does: to the customer, to the money, to the data. The tester usually proposes it, because they saw the harm. Scale: critical, high, medium, low.
- Priority is how soon to fix it. The business or the product owner decides it, because it depends on the plan, the customers, the advertising. Scale: high, medium, low.
They often differ. A spelling mistake in the shop's name does little harm but is fixed today. A wrong annual report does a lot of harm but has 10 months until the next run.
Both are judgement, not fact. Two good testers may give a different severity, and that is normal. What matters is that you can say why.
Try it
Severity or priority?
Try it
The first report
In the tasks below the shop is not quite right. Each has one hidden bug, deliberately put into an otherwise correct system. In the Gherkin module such a version with one bug is called a mutant: your scenarios caught it if they failed on it. Here the bug has already been caught. You know roughly where it is. Your job is the report.
How the task works:
- you build the steps from the feature's step vocabulary and type the values;
- Try runs your steps on the system with the bug and shows what it gives;
- you choose expected (what the rule says) and actual (what you saw);
- you give a severity and a priority.
The check runs your steps on the system with the bug (the bug must show there) and on the correct one (it must not). The title is only partly checked: it must not be empty or "does not work". Severity and priority are compared with the model report, which you see after your attempt.
Find an amount at which the bug shows, and write the report.
for orders well under 50 €
The rule: Delivery is free for an order from 50 € inclusive, otherwise it is 4.90 €. An empty cart cannot be ordered.
Steps to reproduce
- No steps yet. Add them from the vocabulary below.
The steps come from the vocabulary of the feature, as in the scenarios. The values go into the step itself: an amount like 50.00.
The model report
- Title
- Delivery is free for an order of 30.00 €
- Steps to reproduce
- Given a cart of 30.00 €
- When I place the order
- Expected
- delivery is 4.90 €
- Actual
- delivery is free
- Severity
- high. The order goes through and the customer is happy, but the shop loses 4.90 € on every order between 5 € and 50 €, and those are most orders. Nothing has stopped, so it is not critical, but the harm is large and grows every hour.
- Priority
- high. The money is being lost today. It is fixed right away, without waiting for the next planned release.
The bug shows only between 5 € and 50 €: under 5 € both the correct system and the one with the bug charge 4.90 €, and from 50 € neither charges anything. That is why the report with 3.00 € reproduces nothing. The good report has two steps, and the expectation is the number from the rule, 4.90 €. "The order is accepted" is true for both systems and does not show the difference.
The idea
How to find the shortest steps
You saw the bug after 12 steps: add, remove, change the quantity, enter a code, remove the code. The developer should not have to go through all of them. Before you write, narrow it down:
- remove a step and try again. Is the bug still there? Then the step is not needed;
- change one value at a time. At 30 € the bug is there, at 3 € it is not: so it is in the total, and you know roughly where the boundary is;
- write down the exact data. Not "some amount" but 30.00 €. Not "a few items" but 8 and then 3.
That is also the difference between "works on my machine" and "fixed the first time".
Exercise
Defect reports
1. The delivery fee. The bug is in the price of paid delivery.
Write a report from which the bug gets fixed the first time.
in the price of paid delivery
The rule: Delivery is free for an order from 50 € inclusive, otherwise it is 4.90 €. An empty cart cannot be ordered.
Steps to reproduce
- No steps yet. Add them from the vocabulary below.
The steps come from the vocabulary of the feature, as in the scenarios. The values go into the step itself: an amount like 50.00.
The model report
- Title
- Paid delivery costs 4.99 € instead of 4.90 €
- Steps to reproduce
- Given a cart of 20.00 €
- When I place the order
- Expected
- delivery is 4.90 €
- Actual
- delivery is 4.99 €
- Severity
- low. The customer pays 9 cents more. The order goes through and nothing is lost: the harm is small.
- Priority
- medium. Little harm, but the price is not the advertised 4.90 €: customers complain, and for consumer protection this is a wrong price. It is fixed in the next release, and some teams would ship it right away.
At 60 € delivery is free in both systems, so the bug does not show. You need an amount under 50 €. Severity is low, because it is 9 cents. Priority is a judgement: the advertised price is 4.90 €, and some teams would fix it right away. That is why "high" is accepted too.
2. The eleventh item. The bug is around the upper limit of the cart.
Write a report from which the bug gets fixed the first time.
when the cart goes past the upper limit
The rule: The cart can hold at most 10 of one product. Adding beyond 10 is refused with a message, and the cart stays the same. You add at least 1 item.
Steps to reproduce
- No steps yet. Add them from the vocabulary below.
The steps come from the vocabulary of the feature, as in the scenarios. The values go into the step itself: an amount like 50.00.
The model report
- Title
- The cart accepts an 11th item of one product
- Steps to reproduce
- Given the cart has 10 of the product
- When I add 1 more
- Expected
- adding is refused
- Actual
- adding is accepted
- Severity
- low. The customer takes one item more than the limit. The limit protects the stock in a sale, but one item does not use it up, and the total and the payment are right.
- Priority
- low. It happens rarely: only when someone wants exactly 11. It goes into the plan with the other small fixes, unless a sale is coming up.
With 9 items and 1 more the cart becomes 10, and the correct system allows that too. The bug is at 11. This is the classic example of low severity and low priority: a real bug that can wait, unless a sale is coming.
3. The refusal that empties. The bug is in what stays in the cart after a refusal.
Write a report from which the bug gets fixed the first time.
in what stays in the cart after a refusal
The rule: The cart can hold at most 10 of one product. Adding beyond 10 is refused with a message, and the cart stays the same. You add at least 1 item.
Steps to reproduce
- No steps yet. Add them from the vocabulary below.
The steps come from the vocabulary of the feature, as in the scenarios. The values go into the step itself: an amount like 50.00.
The model report
- Title
- The cart is emptied when adding goes past the limit of 10 items
- Steps to reproduce
- Given the cart has 8 of the product
- When I add 3 more
- Expected
- the cart has 8 of the product
- Actual
- the cart has 0 of the product
- Severity
- medium. The refusal is right, but the customer loses the items already in the cart and has to find them again. No money is lost and ordering is still possible, so it is not high.
- Priority
- high. It hits exactly the customers who buy a lot, and exactly in a sale, when the limit is reached most often. Many will give up rather than fill the cart again.
The refusal is right in both systems, so "adding is refused" does not show the difference. The difference is in the items that remain: 8 against 0. "Given an empty cart" before "the cart has 8 of the product" is a redundant step: the second one overrides the first. Priority is high or medium, because it hits the customers who buy the most.
Test
Check yourself
Related lessons
Section titled "Related lessons"- Builds on: Why programs fail · Test levels · Test types · The plan and risk-based testing
- Continues in: Tests in CI · Promo codes: from the request to the release
- Tasks on this topic: Levels, types and process