Gapped code clone detection with lightweight source code analysis
Authors:
- 1 May 2013
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- No. 10928138,p. 93-102
Abstract
A variety of methods detecting code clones has been proposed before. In order to detect gapped code clones, AST-based technique, PDG-based technique, metric-based technique and text-based technique using the LCS algorithm have been proposed. However, each of those techniques has limitations. For example, existing AST-based techniques and PDG-based techniques require costs for transforming source files into intermediate representations such as ASTs or PDGs and comparing them. Existing metric-based techniques and text-based techniques using the LCS algorithm cannot detect code clones if methods or blocks are partially duplicated. This paper proposes a new method that detects gapped code clones using the Smith-Waterman algorithm to resolve those limitations. The Smith-Waterman algorithm is an algorithm for identifying similar alignments between two sequences even if they include some gaps. The authors developed the proposed method as a software tool named CDSW, and confirmed that the proposed method could resolve the limitations by conducting a quantitative evaluation with Bellon's benchmark.Keywords
This publication has 22 references indexed in Scilit:
- On the Effectiveness of Simhash for Detecting Near-Miss Clones in Large Scale Software Systems2011
- Approximate Code Search in Program Histories2011
- Acceleration of the Smith–Waterman algorithm using single and multiple graphics processorsJournal of Computational Physics, 2010
- DECKARD: Scalable and Accurate Tree-Based Detection of Code Clones29th International Conference on Software Engineering (ICSE'07), 2007
- Clone detection using abstract syntax trees2002
- Identifying similar code with program dependence graphs2002
- A survey of longest common subsequence algorithms2002
- CCFinder: a multilinguistic token-based code clone detection system for large scale source codeIEEE Transactions on Software Engineering, 2002
- Parameterized Duplication in Strings: Algorithms and an Application to Software MaintenanceSIAM Journal on Computing, 1997
- Identification of common molecular subsequencesJournal of Molecular Biology, 1981