期刊文献+

一种改进的基于文本的重复代码自动识别方法 被引量:2

An Improved Approach for Automatic Detection of Duplicated Code Based on Text
下载PDF
导出
摘要 代码味道的识别与自动重构是近年来软件工程的热点领域之一,而重复代码是一种在软件工程中较为常见的代码味道。本文在基于文本的重复代码识别方法的基础上,通过词法分析对特定的Token作出处理后再对源代码进行对比,最后通过语法树的对比来对结果进行过滤以降低误报率。测试结果表明该方法对于重复代码有着较好的识别效果。对重复代码的自动识别算法研究有着借鉴意义,在软件的质量、维护等领域上也具有广泛的应用需求。 In the recent years, detection and automatic refactoring of code smell is one of the focus topic in software engineering, and duplicated code is a kind of common code smell. Based on the duplicated code recogni-tion method of text, the false positives can be reduced through the lexical analysis to compare the source code after handling the specific token and through the comparison with the abstract syntax tree to filter the results. The test re-sults show that the method has better detection effect of duplicated code. This has great significance in the study of automatic detection algorithm of duplicated code, and there is also wild application in software maintenance and software quality.
作者 刘伟 宾航飞 胡志刚 LIU Wei;BIN Hang-fei;HU Zhi-gang(School of Informatics,Hunan University of Chinese Medicine,Changsha 410208,Hunan,China;School of Software,Central South University,Changsha 410075,Hunan,China)
出处 《软件》 2018年第10期68-73,共6页 Software
关键词 重复代码 代码味道 自动识别 抽象语法树 Duplicated code Code smell Automatic detection Abstract syntax tree
  • 相关文献

参考文献8

二级参考文献111

  • 1曹羽中,金茂忠,刘超.克隆代码检测技术综述[J].计算机工程与科学,2006,28(z2):9-13. 被引量:6
  • 2聂林波,刘孟仁.软件缺陷分类的研究[J].计算机应用研究,2004,21(6):84-86. 被引量:39
  • 3梁成才,章代雨,林海静.软件缺陷的综合研究[J].计算机工程,2006,32(19):88-90. 被引量:19
  • 4罗宜美,黄胜延,曹式有.改进鱼骨图在生产管理中的应用[J].工业工程,2007,10(2):138-141. 被引量:27
  • 5单锦辉,徐克俊.软件故障诊断探讨[J].北京化工大学学报(自然科学版),2007,34(A01):5-8. 被引量:9
  • 6JavaCC[ EB/OL]. https://javacc, dev. java. net/, Accessed October 2007.
  • 7JDK1.5 [ EB/OL]. http://java, sun. com/javase/downloads/index. jsp, Accessed March 2008.
  • 8Toshihiro Kamiya, Shinji Kusumoto, Katsuro Inoue. CCFinder: a multilinguistic token-based code clone detection system for large scale source c.ode[ J]. IEEE Transactions on Software Engineering, 2002, 28(7) : 654-670.
  • 9Ira D Baxter, Andrew Yahin, Leonardo Moura, et al. Clone detection using abstract syntax trees[ C]. Proceedings of the Internation- al Conference on Software Maintenance, 1998, 368-377.
  • 10Komondoor R, Horwitz S. Using slicing to identify duplication in source code[ C]. Proceedings of the 8th International Symposium on Static Analysis, 2001, 40 - 56.

共引文献54

同被引文献13

引证文献2

二级引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部