Clone Detection/Removal Benefits Calculations

What's Wrong With Cloning Code?

Programmers frequently create code by copying and adjusting existing functions into new code paths. This is a fast way to write code, but it has downstream drawbacks. First off, any errors in the original code are unknowingly cloned. Problems multiply during maintenance, since all changes of the functionality now must be done in two (or more) places, assuming anybody remembers the problem is in multiple places. This results in redundant maintenance effort, or worse, defects because code that requires change was overlooked. Furthermore, analysis is made difficult because the system structure is obscured: modules look large and different and code commonality is not readily apparent.

What's the Solution To Too Much Duplication?

Use Semantic Designs’ CloneDR to detect duplicate and near-duplicate code. The tool can replace such sections with parameterized calls to utility subroutines/methods that it creates. It automatically reduces the source code size and improves system structure. Additional improvements to quality can be made by manually reviewing the near duplicate sections for defects.

How Much Can You Save If It's Gone?

1) Estimate the amount of duplicate code in your system based on system size*:
Input the number of Source Lines of Code in your system:

2) Calculate how much code each of your programmers is responsible for maintaining:
Input the number of programmers actively maintaining (fixing bugs) in your system:

3) Calculate cost savings:
Input the average annual salary of your maintenance programmers (note: IT average = $83,000yr**) :

* Basis of Estimate: Baker, B. S. quotes 13%-20%, from paper “On Finding Duplication and Near-Duplication in Large Software Systems.” 2nd working conference on reverse engineering 1995.
** Source: InfoWorld 2004 Compensation Survey,




Clone Removal
Calculator