Short answer
You test an urgent fix in 30-60 minutes following a fixed plan: reproduce the bug, check the fix, add a regression test for that bug, run the automated smoke test of the critical paths and have a rollback plan ready. After release, watch errors and metrics, confirm with the reporter that it works, and do a short review of why the tests didn’t catch it. If the bug came with the latest release and the fix isn’t obvious, rolling back is often faster and safer.
Hotfix test plan
| step | what to do | time |
|---|---|---|
| 1. reproduce | reproduce the bug on staging or a copy of the data, before the fix is written | 10-20 min |
| 2. fix | check the failing scenario and 2-3 variants next to it, e.g. different data, a different role | 10-15 min |
| 3. regression test | add an automated test that catches this bug if it comes back | together with the fix |
| 4. smoke | automated smoke test of the critical paths in CI | a few minutes |
| 5. rollback plan | it’s clear who rolls back the change, and how, if something goes wrong | before release |
| 6. watch | errors, logs, business metrics after release | 30-60 min |
Without step 1 you don’t know whether the fix addresses the right problem. Without step 3 the same bug returns with the next change.
Hotfix or rollback
| situation | better option |
|---|---|
| bug from the latest release, rollback doesn’t break data | roll back |
| the fix is one obvious line | hotfix |
| the release included a database migration that can’t be undone | hotfix |
| the bug existed for a long time and only surfaced now | hotfix |
| the cause is unknown | roll back if possible and look for the cause without pressure |
What not to skip under time pressure
- the CI pipeline: a hotfix without tests is the most common cause of the next hotfix;
- code review: even 5 minutes from a second person;
- making sure the fix reaches the main branch: otherwise the bug returns in the next release;
- communication: the customer support team knows the problem is fixed.
After the hotfix: a short review
Within 2-3 days of release, answer three questions, without looking for someone to blame:
- Why did the bug get through testing?
- Which test or process change will catch it next time?
- Do similar places in the app have the same problem?
If hotfixes happen more than once a month, it’s worth looking wider. The list of practices is in how to reduce bugs in production, and the share of releases that needed a fix is one of the quality metrics worth tracking.
How I can help
As part of QA support I test urgent fixes in your team and set up a fixed hotfix test plan with you, and as part of test automation I build a smoke test that runs in minutes. Describe your situation in the contact form.