IEEE Transactions on Software Engineering · 2002 · 1.7K citations · 13 references
ComputingComputer ScienceOperating SystemsProgramming LanguagesSoftware EngineeringAbstract Syntax TreesLexical AnalysisSoftware MaintenanceSoftware MetricsStatic Code AnalysisClone DetectionCode Clone DetectionCode Similarity AnalysisSoftware Code SimilaritySource Code CloningSource Code Transformation
Code clones are identical or similar code fragments that can reduce software maintainability, prompting the development of various detection techniques. This study introduces a new clone detection method based on transforming source text and performing token‑by‑token comparison. The authors implemented the method in the CCFinder tool, supporting C, C++, Java, COBOL, and others, and enhanced it with optimization techniques, clone metrics, and case studies on large systems such as JDK and Linux. CCFinder successfully identified clones and the metrics accurately characterized system properties across the evaluated codebases.
A code clone is a code portion in source files that is identical or similar to another. Since code clones are believed to reduce the maintainability of software, several code clone detection techniques and tools have been proposed. This paper proposes a new clone detection technique, which consists of the transformation of input source text and a token-by-token comparison. For its implementation with several useful optimization techniques, we have developed a tool, named CCFinder (Code Clone Finder), which extracts code clones in C, C++, Java, COBOL and other source files. In addition, metrics for the code clones have been developed. In order to evaluate the usefulness of CCFinder and metrics, we conducted several case studies where we applied the new tool to the source code of JDK, FreeBSD, NetBSD, Linux, and many other systems. As a result, CCFinder has effectively found clones and the metrics have been able to effectively identify the characteristics of the systems. In addition, we have compared the proposed technique with other clone detection techniques.
13
Algorithms on strings, trees, and sequences
Dan Gusfield · 1997 · 1.7K citations
Clone detection using abstract syntax trees
Ira D. Baxter, A. Yahin, Leonardo de Moura et al. · 2002 · 1.3K citations