A Token-based Code Clone Detection Tool - CCFinder and Its Empirical Evaluation

Toshihiro Kamiya, Shinji Kusumoto, Katsuro Inoue · 2001

A code clone is a code portion in source files that is identical or similar to another. Since code clones generally reduce maintainability of software, several code clone detection techniques and tools have been proposed. This paper proposes a new clone detection technique, which consists of transformation of input source text and token-by-token comparison. Based on the proposed code clone detection technique, we developed a tool named CCFinder, which extracts code clones in C/C++ or Java source files. As well metrics for code clones were developed. In order to evaluate the usefulness of the tool and metrics, we conducted several experiments. As the results, the tool found several subsystems in two operating systems, namely FreeBSD and Linux, that could be traced to the same original. As well, the proposed metrics found interesting clones in a Java library, JDK. †Graduate School of Engineering Science, Osaka University ‡Graduate School of Information Science, Nara Institute of Science and Technology Contact to: Toshihiro Kamiya c/o Katuro Inoue Division of Software Science Graduate School of Engineering Science, Osaka University, Machikaneyama-cho 1-3, Toyonaka-city, 860-8531, Japan Phone: +81-6-6850-6571, Fax: +81-6-6850-6574 e-mail: [email protected]

Read the paper · More papers on PaperTik