Skip to content
TestLine Menu
TestLine
QA process

How to reduce bugs in production? 10 practices

Where production bugs come from, 10 practices that reduce them, the order to introduce them and one metric to track progress.

author
Artur Machowski, Senior QA Engineer
published
reading
7 min

Short answer

Five things reduce production bugs fastest: a review of the last 20-30 production bugs to see where they come from, an automated smoke test of critical paths in CI, a regression test for every bug fixed, clear release criteria, and monitoring with fast rollback. The first effects usually show after 1-2 months. Track progress with one metric: the share of bugs found only in production (escape rate).

First, find out where bugs come from

Take the last 20-30 production bugs and write down one cause for each. Usually a few groups come out:

causeexamplepractice that helps
no regression testa fixed bug came back after a later change3, 4
unclear requirementthe feature works, but not the way the client wanted5
environment differenceworks on staging, fails in production6
datanon-ASCII characters, empty fields, large accounts6
integrationa change in a partner’s API or another service3, 9
configuration and releasea wrong environment variable, a missing migration7, 8

This table tells you where to start. A team where half the bugs are recurring regressions needs something different from a team where half are environment differences.

10 practices

  1. Production bug analysis. Once a month, as above. Without it, the other practices are shots in the dark.
  2. A list of critical paths. 5-10 paths that must not break: sign-up, login, payment, the main feature.
  3. A smoke test in CI. Automated tests of critical paths on every pull request. How to set it up is in the regression in CI guide.
  4. A regression test for every bug fixed. A fix without a test is an invitation for the bug to come back.
  5. Reviewing requirements before code. A tester or developer asks about edge cases before the code is written. The cheapest bug is the one nobody wrote. Questions for each user story are in testing requirements before code.
  6. A test environment close to production. The same configuration, realistic test data, current versions of services.
  7. Release criteria. What must be true to release: green tests, no open critical bugs, migrations checked.
  8. Gradual releases and feature flags. A new feature first for 5-10% of users or only for the team.
  9. Monitoring and alerts. Application errors, response times, failed payments. Plus the ability to roll back a release in minutes.
  10. A short review after a serious bug. Without looking for someone to blame: what let it through, and which test or process change will catch it next time.

Order of introduction

whenwhat to introduce
week 1production bug analysis, list of critical paths
weeks 2-4smoke test in CI, a test for every fix, release criteria
month 2monitoring and alerts, a rollback procedure
quarterreviewing requirements before code, test environment and data, gradual releases

How to measure progress

  • Escape rate: production bugs divided by all bugs found in a given period. With 12 production bugs and 48 found earlier, that’s 12 / 60 = 20%. The goal is a drop month on month.
  • Critical production bugs per month. An absolute number, the one that matters most to customers.
  • Time from report to fix. Shows whether monitoring and releases work.
  • Hotfixes per month. Every hotfix is an unplanned release.

3-4 metrics counted once a month are enough. More rarely gets read. Formulas and thresholds for more metrics are in which quality metrics make sense.

How I can help

In a QA audit I do exactly this analysis: I review production bugs, the process and the tests, and the report gives you a list of changes ordered by impact. I cover the details, cost and timing in QA audit cost and scope. If you already know that tests in CI are missing, I can build automated regression straight away. Describe your situation in the contact form.

Frequently asked questions

Where do I start reducing bugs in production?

With a review of the last 20-30 production bugs, assigning each one a cause: missing test, unclear requirement, environment difference, data, integration. Then you know which practice to introduce first.

How long before there are fewer production bugs?

The first effects usually show 1-2 months after introducing a smoke test in CI and regression tests for fixed bugs. Changes to the requirements process and environments work more slowly, over a quarter.

How do I measure bugs in production?

Most simply by the share of bugs found only in production (escape rate): production bugs divided by all bugs found in a given period. With 12 production bugs and 48 found earlier, that's 20%.

Do more tests always mean fewer bugs?

No. What matters is whether the tests cover the places bugs really come from. Hundreds of unit tests won't help if most bugs are integrations and environment configuration.

Can you have zero bugs in production?

No. The goal is fewer bugs in critical paths and faster detection and fixing of the ones that get through. That's why monitoring and fast rollback matter as much as tests.

Got a release in a few weeks?

Describe your project in the form. I'll reply with questions about scope or an initial test plan.