It is not the clones themselves that cause faults, inconsistent changes to the clones are what leads to the unexpected program behavior. The inconsistent bug fix of particular concern regarding cloned code. When a bug is found in cloned code it must be fixed in all clone instances or the system will probably continue to misbehave and exhibit incorrect behavior. . Clone detection approaches and tools can mitigate these problems. CCFinder, is one such tool. It functions as a multi-linguistic, token-based, code clone detection system and is designed for large scale source code. It permits the transformation of the input source text then uses a token-by-token comparison and has an implementation tool to optimize techniques. When tested, CCFinder effectively found clones, and metrics, then identified the system characteristics. .
Although code cloning is generally frowned up as a bad practice there are times when duplicating code within a software system is a principled engineering tool. It can be used in a kind of ‘sandbox testbed’ to evaluate possible new system features and gives them a maturation period and allows incremental introduction into the stable code base. .
Works Cited
Aversano, Lerina, et al. "An empirical study on the maintenance of source code clones." Journal of Empirical Software Engineering (2010). <https://www.academia.edu/383410/An_Empirical_Study_on_the_Maintenance_of_Source_Code_Clones>.
Casper, C and M W Godfrey. "Cloning considered harmful” considered harmful: patterns of cloning in software." Empirical Software Engineering 13.6 (2008): 645 - 692. <http://link.springer.com/article/10.1007/s10664-008-9076-6>.
Juergens, Elmar, et al. "Do Code Clones Matter?" n.d. Technische Universitat Munchen. <https://www.cqse.eu/publications/2009-do-code-clones-matter.pdf>.
Kamiya, Toshihiro, Shinji Kusumoto and Katsuro Inoue. "CCFinder: A Multilinguistic Token-Based Code Clone Detection System for Large Scale Source Code." EEE TRANSACTIONS ON SOFTWARE ENGINEERING (2002). <https://www.cs.drexel.edu/~spiros/teaching/CS675/papers/clone-kamiya.pdf>.