Hotfix: How to Test and Release an Emergency Fix in 2026
In this article
The Quick Answer
A hotfix is a change shipped to production outside the normal release cycle because a live defect cannot wait for the next scheduled release. It skips the queue. It should not skip the thinking.
The core tension: a hotfix is the release with the least time to test and the highest cost of being wrong. It goes out under pressure, to a system already failing, often written by someone paged an hour ago. That is exactly when a second defect gets introduced.
Good hotfix testing is not less careful testing. It is less testing, chosen deliberately against a scope agreed in advance - plus the steps around the fix that everyone skips once the incident channel goes quiet.
This article walks the hotfix release process end to end: what qualifies, rolling back vs flagging off vs fixing forward, branching, the minimum test scope, approval, production verification, merge-back, and the test case every hotfix owes the suite. A checklist closes it out.
What Qualifies as a Hotfix - and What Does Not
The decision to hotfix should be made against written criteria, not against the volume of the escalation. A loud customer and a senior stakeholder in the channel can make a cosmetic defect feel like an outage.
A reasonable default: a hotfix is justified when a production defect is causing harm that the next scheduled release would arrive too late to prevent. In practice:
- Outage or unusable core flow - users cannot sign in, pay, or complete the thing the product exists for
- Data loss, corruption or exposure - including one customer seeing another's data, however rare the trigger
- A security vulnerability that is exploitable or already public
- Financial or legal harm accruing by the hour - wrong prices charged, a regulatory deadline, a breached SLA
- No acceptable workaround for the affected users until the next release
If your team uses a priority scale with service levels, this maps cleanly onto the top level: P1 is the hotfix path, P2 waits for the release. Our guide to severity vs priority covers how to define those levels so the call is made on evidence.
What does not qualify: a defect that is embarrassing but harmless, a feature a customer was promised for this week, a fix that is "small, so we might as well", or anything with a workaround support can hand out. These go into the next release. Every hotfix is a release with reduced testing, and a team hotfixing five times a week no longer has a release process.
Hotfix vs Patch
Teams use the terms loosely; the useful distinction is urgency. A hotfix is an emergency change on an expedited path, usually a single fix, deployed as soon as it is verified. A patch is any release that fixes defects without adding features - often scheduled, often bundling several fixes, and in semantic versioning the third number. A hotfix is a kind of patch; most patches are not hotfixes.
The First Decision: Roll Back, Flag Off or Fix Forward
Before anyone writes code, ask whether a fix is actually the fastest safe way to stop the harm. Often it is not. The goal in the first hour is restoring service, and a new change is the slowest and riskiest way to do that.
| Option | Use it when | Avoid it when | Testing needed |
|---|---|---|---|
| Roll back to the previous release | The defect arrived with the latest deploy and the previous version was healthy | The release included a schema migration or data change that the old code cannot read | Confirm the rollback path works; smoke the restored version |
| Switch the feature flag off | The defect sits behind a flag and the off-path is known to restore prior behavior | The flag was never tested in the off state, or the defect is outside the flagged code | Verify the off-path in production; check nothing depends on the new state |
| Fix forward with a hotfix | Rollback is unsafe or impossible, the defect is old, or the cause is understood and the change is small | The cause is still a guess, or the fix touches several components | The full minimum scope described below |
Prefer the options top to bottom. A rollback or flag change returns to a state already run in production; a fix forward moves to a state nobody has run anywhere. If you can reverse, reverse first, then write the proper fix on the normal release path.
Flags only help if their off-path was tested before it was needed, as argued in testing in production. A flag never switched off in anger is a hope, not a mitigation.
Branching: Start From the Release Tag
The most common structural mistake in a hotfix is branching from main. On most teams, main already contains work merged since the last release - features half finished behind flags, refactors, dependency upgrades. Branch from there and the hotfix ships all of it, untested, in an emergency.
Branch from the tag or commit actually running in production. The hotfix branch then differs from production by exactly one change, which is what makes a small test scope defensible. If you cannot say which commit is live, fix that after the incident.
In git-flow, hotfix branches come off the production branch and merge back into it and the development branch. In trunk-based development, the fix is usually made on trunk and cherry-picked onto the release branch. Either way, what you test and deploy must be production plus one change.
Build it once: the build you test must be the exact build you deploy. Rebuilding from the same branch "to be safe" after testing produces an artifact nobody has tested.
The Minimum Test Scope for an Emergency Fix
You will not run the full regression suite. You should not pretend otherwise, and you should not skip testing either. The minimum scope has four parts, in this order.
1. Reproduce the defect first
Reproduce the defect on the unfixed build, in a test environment, with known steps. This is the step people skip under pressure and the one that matters most. If you cannot make it fail, you cannot prove the fix made it pass - only that it does not fail right now, which may be true for unrelated reasons. Write the steps down; they become the test case later.
2. Verify the fix
Run the same steps on the hotfix build and confirm the failure is gone. Then vary it: the other currency, the other user role, the empty case, the large case. The first report of a production defect usually describes one instance of a class, and a fix that handles the instance but not the class will be back within the week.
3. Targeted regression around the change
Read the diff and test what it touches: every caller of the changed function, every screen that renders the changed data, every integration that consumes the changed response. This is a narrow slice of regression testing, chosen from the change rather than from the suite. If the change touches a shared component, the slice gets wider - and that is a signal fix forward may have been the wrong choice.
4. A smoke pass on the build
Confirm the build as a whole is viable: it deploys, it starts, the critical paths work. Steps 2 and 3 amount to a sanity check and step 4 is a smoke test; the difference is covered in smoke vs sanity testing. Automated CI checks run too - an emergency is not a reason to disable the pipeline.
Preparation pays for itself here. A team that keeps a pre-built hotfix run - smoke and critical-path cases, ready to copy - can assemble the scope in minutes with a test run builder and add the targeted cases on top, instead of deciding what to test from memory at two in the morning.
What to skip, explicitly: full regression, performance testing, exploratory sessions, broad cross-browser matrices, and anything unrelated to the change. Write down what was skipped, so the approver accepts that risk knowingly.
Who Approves the Release
A hotfix needs an approver who is not the author, and the approval should be quick precisely because the criteria were agreed beforehand. The approval is not a formality; it is the moment someone confirms three facts.
- The criteria are met. This defect qualifies, and rollback or a flag was considered and rejected for a stated reason.
- The minimum scope ran. Reproduced, verified, regression around the change, smoke - with results recorded, not reported verbally.
- The skipped scope is accepted. Someone with the authority to take the risk has seen what was not tested.
Keep the group small: the engineering lead or incident commander, whoever ran the tests, and the product owner when the fix changes visible behavior. Regulated environments add change-control requirements; pre-agree the emergency path with whoever owns them rather than negotiating during the incident.
Code review still happens. It can be short and synchronous - one reviewer on a call reading a twenty-line diff - but a hotfix nobody else has read is the change most likely to cause the second incident.
Deploying and Verifying in Production
Deploying the fix is not the end of the test. Production gets the final say.
Where your platform supports it, release progressively - a canary or a small share of traffic first - and watch the signal that showed the defect: the error rate on that endpoint, the failed payments count, the support queue for that symptom. Where it does not, have the rollback command ready before you deploy.
Then verify directly. Run the reproduction steps against the live system with a test account, if that is safe. Run the production smoke checks. Confirm with support that new reports have stopped. Agree a watch window - thirty minutes, two hours, a full business day for a defect with a daily cycle - and name who is watching.
Two things are easy to miss. Data already damaged: a fix stops new corruption but does nothing for records affected before it landed, which need a separate, tested remediation. Queued work: jobs and retries created while the defect was live may be processed by the new code with old assumptions baked in.
The Merge-Back Step Everyone Forgets
Here is the failure that makes teams distrust their own release process. The hotfix ships from a branch cut from the release tag. The incident closes. Nobody merges the fix into main. Three weeks later the next regular release is cut from main - without the fix - and the defect returns, now as a regression, in a release that passed its full test cycle.
It happens because merge-back is the one step with no pressure behind it.
Make it part of done: the hotfix is not closed until the fix is merged into every branch that will ship again - main and any supported release branch. Make the incident ticket require the merge commit, and have QA verify the fix on the next release candidate as a named test.
Expect conflicts. main has moved since the tag, and a fix that was correct against the old code can be wrong against the new. Resolve with the author and retest on main.
The Test Case That Must Be Added
Every hotfix exposes a gap: a scenario the suite did not cover, or covered and asserted wrongly. Before the ticket closes, the reproduction steps become a permanent test case at the lowest level that can catch it - a unit test where the logic allows, an integration or end-to-end case where it does not, a documented manual case where automation is impractical.
That case joins the regression suite and runs on the release that carries the merge-back. It answers two questions: did the fix hold, and will the same defect be caught next time. It is also the cheapest step, because the steps were written during reproduction.
Then hand over to a root cause analysis. The hotfix answers how you stopped the harm; the RCA answers why the defect was not caught and what would stop the next one. Anything that went through the hotfix path should meet the trigger for one - the method is in our guide to escaped defects and post-release RCA. What the hotfix contributes is evidence: the reproduction, the test run and its results, the skipped scope and the timeline, recorded as it happened.
A Hotfix Checklist
Keep it as a template run, so nobody has to remember it under pressure.
- Qualify: meets the written criteria; decision recorded
- Mitigate first: rollback and flag considered; reason recorded if rejected
- Branch: from the production release tag, not
main - Reproduce: fails on the unfixed build, steps recorded
- Verify: same steps pass on the hotfix build, plus input variations
- Targeted regression: whatever the diff touches
- Smoke: deploys, starts, critical paths work, CI green
- Skipped scope: listed and accepted by the approver
- Review and approve: a reviewer who is not the author, plus the agreed roles
- Deploy: the tested artifact, progressively where possible, rollback ready
- Verify in production: reproduction steps, smoke checks, defect signal, watch window with an owner
- Remediate data: damaged records handled separately
- Merge back: into
mainand every supported release branch, retested - Add the test case: the reproduction becomes permanent regression coverage
- Hand off: to the RCA with run, results and timeline attached
Common Mistakes
- Hotfixing on volume, not criteria. The loudest escalation gets an emergency release; the release process erodes one exception at a time.
- Fixing forward when a rollback was available. A new, lightly tested change is chosen over returning to a version that already ran in production.
- Branching from main. Unreleased work ships with the fix, untested, in the worst possible release to debug.
- Testing the fix without reproducing the bug. The test passes, which proves nothing about whether the fix did anything.
- Rebuilding after testing. The deployed artifact is not the one that was tested.
- Declaring victory at deploy. No production verification, no watch window, no check on data damaged before the fix.
- Forgetting the merge-back. The defect returns in the next regular release, which then looks like a regression.
- No new test case. The gap that let the defect through is still open for the next one.
Conclusion
A hotfix is a controlled exception to the release process, and the control is what makes it safe. Decide against criteria written before the incident. Reverse before you fix forward when reversing is possible. Branch from what is in production, so the change you test is the only change you ship.
The testing is smaller than a normal release but not casual: reproduce first, verify across variations, test around the diff, smoke the build, and write down what you skipped. Verify in production against the signal that showed the defect, and deal with the records it damaged.
Then do the steps with no pressure behind them - merge the fix back so it cannot return, add the test case so the gap is closed, and hand the evidence to the RCA. That is where a rescue becomes an improvement.
Having the emergency scope ready before the emergency is most of the battle. QA Sphere lets you keep a hotfix run as a template and assemble it in minutes with the test run builder, keeps the full results history for every run in reporting so the RCA starts from evidence, and links the defect and the fix to your tracker through issue tracker integration. See pricing or book a demo.
Written by
QA Sphere TeamThe QA Sphere team shares insights on software testing, quality assurance best practices, and test management strategies drawn from years of industry experience.



