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

保持语义不变的C克隆代码预处理方法
引用本文:边奕心,赵松,杜军.保持语义不变的C克隆代码预处理方法[J].电子科技大学学报(自然科学版),2017,46(6):926-933.
作者姓名:边奕心  赵松  杜军
作者单位:1.中国科学院软件研究所 北京 海淀区 100190
基金项目:黑龙江省自然科学基金F2016030
摘    要:克隆代码检测工具的输出结果由于存在克隆检测不一致性缺陷的误检和检测出的克隆代码不能直接用于重构的问题,需要对检测工具的输出结果进行预处理。为了解决该问题,提出一种新的克隆代码预处理方法。首先,将自适应K-最近邻聚类方法与程序依赖图相结合,用于降低克隆不一致性相关缺陷检测的误检。然后,使用基于代价-收益分析的评估方法,在消除缺陷后的克隆代码中识别可重构的克隆代码。实验结果表明,该预处理方法,不仅降低了克隆不一致性相关缺陷检测工具产生的误检,提高了可重构克隆代码的数量,而且将克隆代码检测与克隆代码重构两个过程连接为一个有机的整体,有利于提高软件的质量,降低软件维护的成本。

关 键 词:自适应K-最近邻聚类    克隆代码    克隆不一致性缺陷检测    程序依赖图    重构
收稿时间:2016-09-14

Semantic-Preserving Pre-Processing Method for C Clone Code
Affiliation:1.Institute of Software Chinese Academy of Sciences Haidian Beijing 1001902.College of Computer Science and Information Engineering, Harbin Normal University Harbin 150025
Abstract:The output results of clone code detection tool cannot be directly refactored because of the two reasons:one is the false positives of clone inconsistency related bugs detection and the other is that all the detected clones cannot be suitable for refactoring. Therefore, the output results of clone code detection tool need to be pre-processed for reducing the error checking of cloning inconsistencies defect. A pre-processing approach combing adaptive K-nearest neighbor clustering with program dependence graph is proposed in this paper to solve these problems. First, adaptive K-nearest neighbor clustering and program dependence graph are used to reduce the false positives of clones inconsistency related bugs detection. And then the refactorable clone code is identified to reduce the cost of clone maintenance. The results of the study show that our approach not only effectively prunes the false positives of clone inconsistency related bugs but also eliminates the gap between clone code detection and clone refactoring. Therefore, our method contributes to improving the quality of the software and decreasing the cost of software maintenance.
Keywords:
点击此处可从《电子科技大学学报(自然科学版)》浏览原始摘要信息
点击此处可从《电子科技大学学报(自然科学版)》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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