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

克隆代码分析方法研究
引用本文:王克朝,朱宸光,王甜甜,苏小红.克隆代码分析方法研究[J].计算机应用研究,2017,34(3).
作者姓名:王克朝  朱宸光  王甜甜  苏小红
作者单位:哈尔滨学院 软件学院,哈尔滨工业大学 软件学院,哈尔滨工业大学 计算机科学与技术学院,哈尔滨工业大学 计算机科学与技术学院
基金项目:国家自然科学(61202092,61173021);高等学校博士学科点专项科研(20112302120052);黑龙江省普通高校青年学术骨干项目(1254G037);黑龙江省自然科学基金(F201127);哈尔滨科技创新人才研究专项资金项目(RC2013QN010001和2014RFQXJ062)
摘    要:针对已有克隆代码检测工具只输出克隆组形式的检测结果,而无法分析克隆代码对软件质量的影响问题,提出危害软件质量的关键克隆代码的识别方法。首先,定义了克隆代码的统一表示形式,使之可以分析各种克隆检测工具的检测结果;接下来,解析源程序和克隆检测结果,识别标识符命名不一致性潜在缺陷;然后,定义了克隆关联图,在此基础上检测跨越多个实现不同功能的文件、危害软件可维护性的克隆代码;最后,对检测结果进行可视化统计分析。本文的克隆代码分析工具被应用于分析开源代码httpd,检测出了1组标识符命名不一致的克隆代码和44组危害软件可维护性的关键克隆类,实验结果表明,本文方法可以有效辅助软件开发和维护人员分析、维护克隆代码。

关 键 词:克隆代码  克隆代码分析  克隆代码维护  缺陷检测
收稿时间:2015/12/4 0:00:00
修稿时间:2017/1/18 0:00:00

Research on code clone analysis approach
WANG Ke-Chao,ZHU Chen-Guang,WANG Tian-Tian and SU Xiao-hong.Research on code clone analysis approach[J].Application Research of Computers,2017,34(3).
Authors:WANG Ke-Chao  ZHU Chen-Guang  WANG Tian-Tian and SU Xiao-hong
Affiliation:School of Software,Harbin University,School of Software,Harbin Institute of Technology,School of Computer Science and Technology,Harbin Institute of Technology,School of Computer Science and Technology,Harbin Institute of Technology
Abstract:Most existing clone detection tools only output the detection results in the form of clone sets, lacking clone analysis. To solve this problem, a key clone recognition approach was proposed. The clones which decrease the quality of software can be analyzed with this approach. Firstly, the unified clone representation form is defined to support the analysis of various clone detection tools. Then, the source code and clone detection results are analyzed to detect identifier renaming inconsistent clones which are potential bugs. Next, the clones diffusing in various functional different files, which may decrease the maintainability of software, are detected. Finally, the detection results are visually analyzed. The proposed analysis tool was applied to analysis the open source code http, 1 identifier renaming inconsistent clone was detected, and 44 clones diffusing in various functional different files were recognized. The experimental results show that it can facilitate the analysis and maintenance of code clones.
Keywords:code clones  clone analysis  clone maintenance  bug detection
点击此处可从《计算机应用研究》浏览原始摘要信息
点击此处可从《计算机应用研究》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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