A AST AND CONTEXT BASED DUPLICATED CODE DETECTING METHOD
This paper presents a duplicated code detecting method based on AST (Abstract Syntax Tree) and context, and designs a flexible rule-based parameterized matching method which is able to locate the consecutive duplicated code by applying the string matching algorithm to some special kinds of AST nodes. Then, the method calculates the searching distance according to the variable association between code lines in the context to detect the nonconsecutive duplicated code. Both the time complexity and the space complexity of the method are O(N). The experiment results prove that the method can detect nonconsecutive duplicated codes.
Duplicated code Abstract syntaz tree Parameterized matching method Matching distance
Wei Liu Chuanchang Liu Yunzhan Gong Junliang Chen Junliang Chen
State Key Laboratory of Networking and Switching Technology, Beijing University of Posts and Telecommunications (BUPT), Beijing 100876, China
国际会议
北京
英文
1-5
2008-09-26(万方平台首次上网日期,不代表论文的发表时间)