一种基于AST的代码抄袭检测方法  被引量:8

AST-based code plagiarism detection method

在线阅读下载全文

作  者:张丽萍[1] 刘东升[1] 李彦臣[1] 钟美[1] 

机构地区:[1]内蒙古师范大学计算机与信息工程学院,呼和浩特010022

出  处:《计算机应用研究》2011年第12期4616-4620,共5页Application Research of Computers

基  金:国家自然科学基金资助项目(60940027);内蒙古自然科学基金资助项目(2010MS0906)

摘  要:针对目前代码抄袭检测方面的研究大多是基于程序源码层面进行相似度比较,不需要对代码进行语法分析,由于忽略程序语法语义,对稍加结构修改的抄袭行为无法有效检测的现状,提出一种基于AST的代码抄袭检测方法。先将代码进行格式化预处理,再进行词法分析、语法分析,得到对应的AST;然后遍历AST生成代码序列,对代码序列进行相似度计算,从而得到代码的抄袭检测报告。实验结果表明,该方法能够有效检测出C程序代码的抄袭行为,并对C++、Java等多种程序代码的抄袭检测具有一定的通用性和可扩展性。Because the current research about code plagiarism detection mostly based on program source code similarity, lacking of grammatical analysis to code, ignoring the syntax and semantics of the program, can not effectively detect plagiarism to the slight modification of the structure. This paper presented a code plagiarism detection based on the AST. It pre-formated code, analysis lexical and syntax and obtained the corresponding AST. Then it traversed AST to generate code sequences, calculated the similarity of the code sequence and got the code plagiarism detection report. Experimental results show that the approach can verify the C code plagiarism effectively, and it has some versatility and scalability on the C ++ ,Java and other plagiarism detection program code.

关 键 词:抽象语法树 抄袭检测 开源语法分析器 相似度 

分 类 号:TP309[自动化与计算机技术—计算机系统结构]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象