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

基于分组的代码克隆增量检测方法
引用本文:王 海,林 云,彭 鑫,赵文耘. 基于分组的代码克隆增量检测方法[J]. 计算机科学与探索, 2014, 0(4): 446-455
作者姓名:王 海  林 云  彭 鑫  赵文耘
作者单位:复旦大学软件学院软件工程实验室,上海201203
基金项目:The National High Technology Research and Development Program of China under Grant No. 2012AA011202 (国家高技术研究发展计划(863计划)).
摘    要:代码克隆是指软件程序中一组相同或相近的代码片段,它广泛存在于软件中,因此如何发现代码克隆成为软件维护的一个重要问题。目前已有的克隆检测工具大多针对单一版本进行完整的克隆检测,然而对于大规模、复杂软件系统而言,在软件演化过程中随着代码的改变,不断重新检测代码克隆将花费较高的代价。针对这一问题,提出了一种基于分组的增量克隆检测方法。该方法根据前后两个版本的差异将源代码分为发生变化和未发生变化的两组,通过组内和组间的克隆分析实现增量的克隆检测。基于所提出的方法,在克隆检测工具CCFinderX的基础上实现了一个名为ICDBG(incremental clone detector based on grouping)的原型工具。实验证明,在变更较小时,该方法能够在保证正确性的同时显著减少克隆检测时间。

关 键 词:程序分析  代码克隆  克隆检测  增量

Grouping-Based Incremental Clone Detection Method
WANG Hai,LIN Yun,PENG Xin,ZHAO Wenyun. Grouping-Based Incremental Clone Detection Method[J]. Journal of Frontier of Computer Science and Technology, 2014, 0(4): 446-455
Authors:WANG Hai  LIN Yun  PENG Xin  ZHAO Wenyun
Affiliation:( Laboratory of Software Engineering, Software School, Fudan University, Shanghai 201203, China)
Abstract:Code clones are identical or similar code fragments in software systems, and extensively exist in soft-ware systems, therefore detecting code clones is deemed as an important issue in software maintenance. The majority of clone detectors detect code clones only in one revision. However, the changes on source codes are on-going as software systems evolve incrementally and iteratively. Thus, re-detecting all the code clones whenever any change happens turns out to be very effort and time consuming. In order to address this issue, this paper proposes an incre-mental clone detection algorithm, which divides the source codes into two groups, the changed and unchanged codes, in a subject software project. By detecting clones inside as well as between those two groups, this algorithm can incrementally detect code clones without re-detecting the whole project. Based on the proposed algorithm, this paper implements a prototype tool called ICDBG (incremental clone detector based on grouping). The experimental results show that ICDBG decreases the detecting time with good accuracy.
Keywords:program analysis  code clone  clone detection  incremental
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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