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:
| cause | example | practice that helps |
|---|---|---|
| no regression test | a fixed bug came back after a later change | 3, 4 |
| unclear requirement | the feature works, but not the way the client wanted | 5 |
| environment difference | works on staging, fails in production | 6 |
| data | non-ASCII characters, empty fields, large accounts | 6 |
| integration | a change in a partner’s API or another service | 3, 9 |
| configuration and release | a wrong environment variable, a missing migration | 7, 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
- Production bug analysis. Once a month, as above. Without it, the other practices are shots in the dark.
- A list of critical paths. 5-10 paths that must not break: sign-up, login, payment, the main feature.
- 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.
- A regression test for every bug fixed. A fix without a test is an invitation for the bug to come back.
- 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.
- A test environment close to production. The same configuration, realistic test data, current versions of services.
- Release criteria. What must be true to release: green tests, no open critical bugs, migrations checked.
- Gradual releases and feature flags. A new feature first for 5-10% of users or only for the team.
- Monitoring and alerts. Application errors, response times, failed payments. Plus the ability to roll back a release in minutes.
- 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
| when | what to introduce |
|---|---|
| week 1 | production bug analysis, list of critical paths |
| weeks 2-4 | smoke test in CI, a test for every fix, release criteria |
| month 2 | monitoring and alerts, a rollback procedure |
| quarter | reviewing 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.