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

QA Fundamentals › Types of testing

How to build and maintain a regression suite

A regression suite is built by risk, value of the signal and the cost of running and maintaining it, not by the number of cases. Every case has a link and an owner, fast critical-path checks run on every build, and a wider set runs nightly or before a release. Stable and frequent checks are automated, outdated cases are retired and flaky tests go into quarantine with a deadline.

QA Fundamentals · Types of testing

The regression suite has grown to two thousand cases and takes three days. What do you do with it?

The suite started with thirty cases and grew to two thousand in three years. A run takes three days, some cases describe screens that no longer exist, a few automated tests fail every other run, and new features are tested separately because someone will "add them to the suite later". At senior level an interview does not ask what regression is, it asks how you build and maintain the suite so that it stays useful. This lesson is about the standing suite. Choosing checks for a particular release by the area of change is covered in the lesson about regression scope.

How it works

A regression suite is a portfolio of checks with a limited time budget. Every case has to justify its place by three things: the risk it covers, the value of the signal it gives, and the cost of running and maintaining it. That is why the suite lives in a cycle: add, assign a tier, run, review, retire.

What goes into the suite. Critical business flows (login, payment, checkout), areas with a defect history, areas that change often, and seams with other systems. Every case has a link: to a requirement, a risk or an incident. A case with no link cannot be retired or updated on solid grounds. After each defect that reached production, a check is added at the cheapest level that would have caught it: often a unit or API test, not one more e2e.

Tiers by run frequency. Fast checks of the critical path run on every build or merge and take minutes. A wider set runs nightly or before a release. Rare and expensive ones (a browser matrix, long flows) run on a schedule or before big releases. Tiers keep the signal fast: a developer gets an answer while still remembering the change.

What to automate and what to keep manual. Automate stable, repeatable, deterministic checks of high value that run often. Keep manual new unstable features, judging usability and looks, one-off and exploratory checks, and those where setup costs more than the gain. Automation is not a goal: it pays off when its maintenance costs less than the repeated manual runs.

Example: reviewing a suite by risk

CaseDecisionWhy
Card payment, happy pathKeep, automated, fastest tierMoney, runs on every build
40 UI cases of a discount for various amounts and languagesReplace: 5 unit and API checks, 1 e2eThe logic is cheaper to check lower, the UI keeps one scenario
The "Bonuses" screen removed in the last releaseRetireIt checks something that does not exist
An export automated test that fails every other runQuarantine with an owner and a deadline: fix or deleteA flaky test teaches the team to ignore red
Judging the new form designManual, not in the suiteNeeds human judgement, the design is still changing

Note that a case that has never failed is not retired automatically: a payment check may not fail for years and still be the most important one. The decision is made by risk, not only by the failure history.

Maintenance. The suite is reviewed on a schedule, for example every quarter or after each big release, and every area has an owner. The indicators of the suite’s health are tracked: duration of each tier, the share of flaky tests, the share of failures that turned out to be real defects, and defects that slipped through in areas without cases. The number of cases is not a goal: more does not mean better.

Limits and alternatives

  • In a small team or at the start of a product a checklist of critical flows is enough: a full suite with tiers and owners costs more than it returns.
  • For a product with no documentation and no defect history, start with production incidents and a talk with support: they show what really breaks.
  • Retiring a case does not mean the risk is gone. If a case is removed and the risk stays, the risk is moved to another level or another kind of check, not forgotten.

Common mistakes

  • Only adding. The suite grows, the run gets longer, and in the end it is cut down at random. Consequence: random gaps instead of a choice.
  • Keeping flaky tests in the main suite. People stop reading the red result and a real breakage gets lost.
  • Automating everything. Maintenance swallows time and flaky checks eat the trust.
  • Having no owner. An area without an owner ages silently: cases describe the old interface.
  • Counting success by the number of cases. Consequence: duplicates and minor variations instead of risk coverage.

Check yourself

The payment automated test fails once every ten runs, with no code changes. The team suggests switching it off. What do you propose?

Answer

Do not switch it off silently, because payment is critical. Move it to quarantine with an owner and a deadline, find the cause of the flakiness (data, waits, environment), fix it, and for the time of the quarantine cover payment with another, steadier check, for example an API test. If it cannot be fixed, rewrite it at a lower level.

After a rounding incident in production you are asked to "add a test". Where and which one?

Answer

First find the lowest level at which the error can be caught: a rounding function is a unit test with boundary amounts. Add it, link it to the incident and the requirement, and add to the regression e2e suite only one end-to-end scenario, if the seam between services could have broken too.

In an interview. Junior: A regression suite checks that new changes did not break existing behaviour. I put in critical flows and places that already had bugs, and I remove outdated cases. Middle/Senior: The suite is a portfolio by risk, value of the signal and cost: every case has a link and an owner, a fast tier runs on every build, a wide one nightly or before a release. I automate what is stable and frequent and keep manual what is unstable or judgement-based. I review on a schedule: duplicates, dead cases and flaky tests go into quarantine with a deadline, and after every escaped defect I add a check at the cheapest level.

More articles in this chapter