Find Once, Fix Everywhere
You know that diagnosing and fixing the same bug over and over again is expensive—it costs developers valuable time that could be spent implementing new features, and hurts customer satisfaction. Therefore, your development organization requires that when you fix a critical bug, you have to make sure that you fix all instances of the bug—not just the instance of the bug that was found and reported.
"Find once, fix everywhere" is the right policy, but it can be challenging to implement when you have a high degree of replicated code due to multiple branches, versions, and product lines. For instance, how do you reliably propagate a fix you made in one branch to all the other branches, when the other branches are active, and code is being modified daily? How do you verify that a critical fix has been applied to a set of branches or versions? Or even to other product lines that share similar code?
Patch Miner, part of the Code Insight suite of source code analysis products, can help you "find once, fix everywhere." With Patch Miner, you can quickly and accurately find every instance of a bug, regardless of the size of the code base. First, you’d fix the bug and commit the fix. Next, you create and register the patch. Once the patch is registered, Patch Miner partitions the patch into code snippets to support searching. When you view the patch using the web interface, there is a listing of each of the code snippets that constitute the patch.
zoom
Patch Miner view showing all snapshots where code may need to be patched
You can then search a specific development branch, across multiple branches or multiple versions, and across complete product lines—in a matter of seconds—and find all snapshots with "similar" snippets where the code may need to be patched. Once you have located all the matches of interest, you can be certain that you now know all the locations that match the original—regardless of modifications such as the code being moved to a different file, or copy-pasted into a new method—and "find once, fix everywhere."

