Hotfix vs bugfix

A bugfix is any change that corrects a defect, and it normally travels the usual path: merged with other work, tested and shipped in the next scheduled release. A hotfix is a bugfix applied to the version already in production, urgently and outside the release schedule, because the defect is too damaging to wait for that release.

The longer version

The difference is one of route and urgency, since both alter the code in the same kind of way. A bugfix joins the queue. It is written against the current development line, reviewed, merged with whatever else is in flight and tested as part of the next release, so it inherits that release's full regression run. A hotfix cannot wait for the queue. It starts from the code that is running in production, carries the smallest change that removes the damage, and ships on its own once it has been checked. Vincent Driessen's Git Flow post gives the hotfix a branch type of its own for this reason. Hotfix branches "arise from the necessity to act immediately upon an undesired state of a live production version", are cut from the tag that marks the production version, and are merged back into the development branch as well, so that the next release also contains the fix.

Patch is the word with two meanings. As a kind of release, a patch release contains bug fixes and nothing else. Semantic Versioning 2.0.0 reserves the third number of a version for it, to be incremented when only backward compatible bug fixes are introduced, so 2.3.1 is a patch on 2.3.0. A patch release can be planned weeks ahead and gather a dozen ordinary bugfixes, or it can be issued within the hour to carry one hotfix. In Driessen's worked example the hotfix for version 1.2 is released as 1.2.1. So hotfix describes how urgently a fix moves, bugfix describes what the change is, and patch describes the release that delivers it. Patch also names the file of changes applied on top of installed software, which is the sense behind patching a server.

The testing differs because the time differs. A bugfix is retested against its original steps, and regression testing around it happens with the rest of the release. A hotfix has minutes or hours, so its testing is narrowed on purpose: reproduce the defect on the production version, confirm the fix removes it, run the checks around the changed code and a smoke test of the paths the business depends on, then deploy and watch. That narrowness is the risk. A hurried change to production code can break something beside it, which is how a hotfix produces a regression bug, and a hotfix that never reaches the development line is undone by the next release. Two rules contain the risk: the rollback plan is settled before the hotfix is deployed, and the fix is merged forward the same day with a test that reproduces the original defect.

The word itself explains the urgency. Wikipedia's entry records that hotfix originally meant patching a hot system, a production server actively serving clients, and that the meaning has since shifted to an update created with urgency or released outside the normal cycle. Microsoft used the term for its quick-fix engineering updates, abbreviated QFE. The opposite is a coldfix, which TechTarget describes as a fix applied while systems are shut down and applications unusable, usually announced well in advance, as in a scheduled maintenance window. A bugfix can travel either way, and the plain definition is the one Marker.io gives: a change to source code that corrects a software bug. Whichever route it takes, the fix starts from a report that lets someone reproduce the defect on the right version, which is why the version, the page and the steps belong in the report before anyone decides how hot the fix needs to be.

Common questions

What is the difference between a hotfix and a bugfix?

A bugfix corrects a defect and ships with the next scheduled release, after the normal review and testing. A hotfix corrects a defect in the version already live and ships by itself, as soon as it is verified, because waiting would cost too much. Every hotfix is a bugfix, and the reverse does not hold.

What is the difference between a patch and a hotfix?

A patch is a release, or a set of changes, that contains fixes and no new features, and under semantic versioning it raises the third number of the version. A hotfix is an urgent fix to production. One patch release can deliver a single hotfix today or a planned batch of routine fixes next month.

When does a bug justify a hotfix?

A bug justifies a hotfix when the harm of leaving it in production until the next release is greater than the risk of an out-of-cycle change. Lost or corrupted data, a security hole, a blocked payment or sign-up path and a legal exposure are the kinds of harm that meet that test. A cosmetic fault with a workaround does not, however annoying it is.

How should a hotfix be tested?

Testing for a hotfix is narrow and fixed in advance: reproduce the defect on the production version, verify the fix against the same steps, run the automated checks around the changed code, and smoke test the critical paths before and after deployment. The wider regression run happens afterwards, when the fix is merged into the development line.

What happens to a hotfix after it is deployed?

After deployment the hotfix has to reach every line of code that will be released later, or the next release will reintroduce the defect. In Git Flow the hotfix branch is merged into both the production branch and the development branch, or into the release branch in place of the development branch while one is open. The fix also gains a test that reproduces the defect, and the incident gets a review of how the defect escaped.

Why is it called a hotfix?

The name comes from where the fix was applied. A hotfix originally meant a change made to a hot system, a production server still serving its users, without taking it down. The word now covers any urgent fix released outside the normal schedule, whether or not the system stays running while it is applied.

What is a coldfix?

A coldfix is the opposite of a hotfix: a fix applied while the system is shut down and unavailable to users. It is planned and announced in advance as part of regular maintenance, so users know to log out and expect the downtime. Like a hotfix, it can carry a single fix or several.

Bug reports that arrive ready to triage.

Collect replay, console, network and browser context with the Free plan.

<script src="…/widget.js" data-key="pb_pub_…">