Here are common scenarios for how previously fixed bugs migrate back into production code:
Missed Branch Patch
Bug fixes made in one branch must be integrated into all other branches of a code base. In most cases, this is done manually. Companies usually impose a policy that if a bug is fixed in BRANCH A, the fix needs to be ported to BRANCH X, Y, and Z. However, with the increasing number of branches and bug fixes, the chances of a developer failing to follow this process increase, especially with the constant pressure to deliver releases on time. The patching tends to be secondary in priority and as a result, some branches are not patched.
Operator Errors
A bug fix usually consists of several snippets in different files. It is very common, when being integrated into another branch, for conflicts to occur with other changes that have been made to these snippets. At that moment, the developer only sees the conflict at the snippet level. The purpose of conflict resolution is to make the build clean, but developers commonly break other developers’ bug fixes unintentionally. To make things worse, many companies use dedicated integration or build engineers to perform this task. They typically have less specific knowledge about changes involved in the conflicts.
In many cases, a bug fix consists of several change sets in the SCM system. It’s common for a developer to mistakenly revert one of several change sets, which subsequently breaks the fix.
Code that Contains Bugs Is Reused
Research shows software typically contains 15-50% duplicated code. Copy-paste is a common practice in programming to save time. In many cases, an entire component may be reused and modified, even within the same branch. When a component of code is reused, buggy code in it is propagated. There is no adequate automated means to keep track of these duplicated bugs.
These issues are due to the proliferation of components, software releases and product variants in modern software development. Component and software reuse, while significantly reducing development cost, also creates a large number of variants. And in parallel branching, employed to streamline software development and support release management needs, it is common for software companies to maintain many old releases in the field while working on a new release, adds to the challenge. Developers continuously make code changes, including bug fixes, in these versions. But keeping these versions in sync is an enormous challenge.