2002 · 622 citations · 14 references
ComputingComputer ScienceAlgorithmsProgramming LanguagesSoftware EngineeringAbstract Syntax TreesControl-flow AnalysisData-flow AnalysisDirected Acyclic GraphsStatic Code AnalysisCode Similarity AnalysisData Flow PatternsDependency Graph AnalysisDependency GraphsDirected GraphsProgram Dependence AnalysisProgram Dependence GraphsProgram Dependency Graph Analysis
We present an approach to identifying similar code in programs based on finding similar subgraphs in attributed directed graphs. This approach is used on program dependence graphs and therefore considers not only the syntactic structure of programs but also the data flow within (as an abstraction of the semantics). As a result, there is no tradeoff between precision and recall; our approach is very good in both. An evaluation of our prototype implementation shows that the approach is feasible and gives very good results despite the non polynomial complexity of the problem.
14
Clone detection using abstract syntax trees
Ira D. Baxter, A. Yahin, Leonardo de Moura et al. · 2002 · 1.3K citations