首页 | 本学科首页   官方微博 | 高级检索  
     检索      

基于AST的程序代码相似性度量研究
引用本文:朱波,郑虹,孙琳琳,杨友星.基于AST的程序代码相似性度量研究[J].吉林大学学报(信息科学版),2015,33(1):99-104.
作者姓名:朱波  郑虹  孙琳琳  杨友星
作者单位:长春工业大学 计算机科学与工程学院, 长春 130012
基金项目:吉林省科技厅自然科学基金资助项目,吉林省教育厅“十二五”科学技术研究基金资助项目
摘    要:针对程序代码相似性检测度量忽略程序语义、出现无效度量的问题, 提出一种基于抽象语法树(AST:Abstract Syntax Tree)的程序代码相似性度量方法。通过预处理去除生成AST时的冗余信息, 再进行词法语法分析, 得到相应的AST; 然后通过自适应阈值的选取方式, 利用AST遍历得到的程序属性、 方法序列, 对AST进行相似度计算, 最终判定是否抄袭, 生成相似度检测报告。实验结果表明, 该方法能有效检测Java程序代码的多种抄袭行为。

关 键 词:相似性度量  抽象语法树  相似度  自适应阈值  
收稿时间:2014-08-27

Research on Similarity Measure for AST-Based Program Codes
ZHU Bo,ZHENG Hong,SUN Linlin,YANG Youxing.Research on Similarity Measure for AST-Based Program Codes[J].Journal of Jilin University:Information Sci Ed,2015,33(1):99-104.
Authors:ZHU Bo  ZHENG Hong  SUN Linlin  YANG Youxing
Institution:School of Computer Science and Engineering, Changchun University of Technology, Changchun 130012, China
Abstract:In order to solve the program code similarity detection measurement which ignores the program semantics and the invalid measurement, we present
an AST(Abstract Syntax Tree) based on the program code similarity measure method. Through the pretreatment redundancy removal in AST generation and the lexical grammar analysis, get the corresponding AST; and then according to the adaptive threshold method,using the AST traversal which include the sequenceand process attributes to take the similarity calculation;finally,determine whether plagiarism and generate the test report.The experimental results show that this method can effectively detect a variety of plagiarism java code.
Keywords:similarity measurement  abstract syntax tree (AST)  similarity  adaptive threshold
本文献已被 万方数据 等数据库收录!
点击此处可从《吉林大学学报(信息科学版)》浏览原始摘要信息
点击此处可从《吉林大学学报(信息科学版)》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号