QA Interview Hub · Knowledge base · Quizzes · Українська

QA Fundamentals › Bugs

The bug report and steps to reproduce

Steps to reproduce are an algorithm for someone who did not see the failure: concrete, atomic, ordered, ending in an observable result. The set must be minimal: extra steps are removed one at a time. Preconditions are kept apart from the steps, and the steps are run from a clean state before sending. Tokens and personal data never go into a ticket.

QA Fundamentals · Bugs and bug reports

A developer reproduces the bug in nine steps, but the minimum is three. How to shorten the path?

The ticket has nine steps: open the site, log in, open the profile, then the history, then the transfer, enter an amount… The developer goes through them and does not see the bug, because three of the nine steps name no values, and two more change nothing. Steps to reproduce are an algorithm for another person: what must be done to see the failure. This lesson is about the properties that make a good algorithm and how to cut it down to the minimum.

How it works and why. The steps are read by a person who has not seen the bug and does not know what you consider obvious. So every step must be concrete (which value, which button), atomic (one action), sequential (the order matters) and end with an observable result. The steps must be minimal: every extra step is a chance to make a mistake and extra time, and also a false lead ("probably the problem is in the profile"). A minimal set shows exactly what is needed for the bug to appear, and so where to look for the cause.

To avoid mixing things up, separate what goes where:

WhatWhereExample
The state of the system before the startPreconditionsUser qa_user_03, balance 5,000 UAH
Where and on what it is runEnvironmentstaging, build 2.14.3, Chrome 129
User actionsStepsOpen "Transfer to card"; enter 100.555
What was seenActual result500, the banner "Something went wrong"
What should have happenedExpected resultA hint about 2 decimal places

A typical mix-up: preconditions written as steps ("1. Create a user, 2. Top up the balance…"), so four of the nine steps turn out to be preparation, not reproduction.

Steps before and after minimisation

Typical

9 steps without values

"Enter an amount", "click the button". The developer has to guess the input and does not know which steps matter, so reproduces slowly or wrongly.

Better

3 steps with values

Open the transfer, enter 100.555, click "Continue". The condition of the bug can be read from the steps themselves.

Figure 1. The same bug before and after minimisation: fewer steps and every value named.

Example: from nine steps to three. The initial version:

1. Open the site
2. Log in
3. Go to the profile
4. Go to the history
5. Click "Transfer"
6. Enter an amount
7. Enter a card
8. Click the button
9. See the error

There is no amount and no card here, and "the button" is not named. Steps 3 and 4 add nothing: the bug depends on neither the profile nor the history, and step 5 is replaced by opening the transfer form directly. Minimisation works like this: remove one step or a group of steps and repeat the scenario. If the bug stays, the step is extra. If it disappears, the step is needed. For data it is the same: gradually simplify values until the bug disappears, and record the last value that still causes it. The result:

Preconditions: user qa_user_03, balance 5,000.00 UAH
1. Open "Transfer to card"
2. Enter the amount 100.555 and the test card 4111 1111 1111 1111
3. Click "Continue"
Actual: 500, the banner "Something went wrong"
Expected: the hint "No more than 2 decimal places"

For API bugs the best steps are the request itself: it can be run in one line, with no UI at all.

curl -i -X POST https://staging.example.test/api/transfers \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <token of qa_user_03>' \
  -d '{"cardNumber":"4111111111111111","amount":100.555}'

The token in a ticket is replaced with a placeholder and the real one is never pasted: dozens of people see a ticket, and a secret in it leaks.

Check before sending. It is worth running the report by your own steps from a clean state (a new browser profile or a new test order) and making sure the bug really reproduces. If the steps reproduce the bug only in your already "dirty" state, this is where it shows. For complex cases record a screen video: it shows that no steps were skipped. Another check: read the steps with the eyes of a person who does not know the product. Is it clear where the "Continue" button is? Is the input data named?

Limits and alternatives. Steps are not always linear: intermittent defects that depend on time and load have no perfect steps. Then write the conditions, the frequency and the evidence instead of inventing a sequence (there is a separate lesson on a non-reproducible bug). For visual defects, besides steps you need the window size, zoom, theme and language. Some teams write the scenario in Given/When/Then format: "Given: a user with a balance of 5,000. When: they enter 100.555. Then: …"; it is the same idea, but with a clear split into context, action and result. Test data: never paste real personal and payment data into a ticket, only test cards and accounts.

Common mistakes.

  • Steps without values: "enter an amount" does not let you reproduce a bug that depends on a specific number.
  • Extra steps on the way to the scenario: the developer spends time and wrongly looks for a link.
  • Preparation among the steps: preconditions mix with actions, and it is unclear what exactly reproduces the failure.
  • Steps from memory: after several repeats the author forgets a detail, and without a check nobody notices.
  • One ticket for several bugs with one set of steps: each needs its own report, otherwise the ticket status says nothing.
  • Not checking for a duplicate before creating: the same bug is filed for the third time.

Check yourself

A ticket has 7 steps. How do you shorten them without losing reproducibility?

Answer

Remove steps one at a time and repeat the scenario. If the bug stays, the step is extra and is deleted. If it disappears, the step is needed. The same for data: simplify values until the bug disappears and write down the last value that still causes it. Preparation goes into the preconditions.

Why is it better to give a curl request in a ticket with an API bug than a screenshot of the response?

Answer

A request can be run immediately and the failure seen without a UI, while a screenshot only shows the consequence. The request shows the method, address, headers and body at once, so the developer sees which value causes the error. The token is replaced with a placeholder.

In an interview. Junior: A report has a title, environment, preconditions, numbered steps, actual and expected result, severity, priority and evidence. The steps must be minimal and sufficient, with concrete data. One bug per report, and I check for a duplicate before creating. Middle/Senior: Steps are an algorithm for a person who did not see the failure, so each step is concrete and atomic, preconditions are separate, and the end of the steps is an observable result. I minimise them by removing one step at a time and simplifying the data, and I run them from a clean state before sending. For an API I add curl, for intermittent bugs I write the conditions, the frequency and logs with the time instead of perfect steps. Real personal data and tokens never get into a ticket.

More articles in this chapter