|
This article is cited in 3 scientific papers (total in 3 papers)
Scalable code clone detection tool based on semantic analysis
Sevak Sargsyan, Shamil Kurmangaleev, Andrey Belevantsev, Hayk Aslanyan, Artiom Baloian Institute for System Programming of the Russian Academy of Sciences
Abstract:
This article describes the methods of code clones detection. New approach of code clones detection is proposed for C/C++ languages based on analysis of existed methods. The method based on semantic analysis of the project, which allows detecting code clones with high accuracy. It is realized as part of LLVM compiler, which allows exceeding existed methods. The tool is consisted of three basic parts. The first part is Program Dependence Graph (PDG) generation and serialization. PDG is constructed during compilation time of the project based on LLVM's intermediate representation. Several simple optimizations are applied on these graphs, then they are serialized to file. The second stage is analyzing of stored PDGs. PDGs are loaded from files and split to subgraphs. Every subgraph is considered as clone candidate. New method is purposed for the splitting, which increases number of detected clones. There are two types of algorithms for clone detection. The first types of algorithms try to prove that the pair of PDGs can not be clones. These algorithms have linear complexity, which allows processing huge amount of PDGs pairs. In case of failure graph isomorphism algorithms are applied for similar subgraphs detection. The last part is integrated system for automatic testing of algorithm’s accuracy. For the project, set of clones are automatically generated, then clone detection algorithms are applied for original source and generated one
Keywords:
semantic analysis, code clones, PDG, LLVM.
Citation:
Sevak Sargsyan, Shamil Kurmangaleev, Andrey Belevantsev, Hayk Aslanyan, Artiom Baloian, “Scalable code clone detection tool based on semantic analysis”, Proceedings of ISP RAS, 27:1 (2015), 39–50
Linking options:
https://www.mathnet.ru/eng/tisp112 https://www.mathnet.ru/eng/tisp/v27/i1/p39
|
Statistics & downloads: |
Abstract page: | 286 | Full-text PDF : | 130 | References: | 36 |
|