摘要
针对克隆代码的大量使用会导致长期软件维护问题甚至引入错误,提出了一种基于决策树的分类器来推荐克隆进行重构。首先,使用Ni Cad进行克隆检测;其次,收集了与克隆关系、克隆代码段和克隆上下文都相关的特征;然后,利用决策树分类器训练;最后,利用K折交叉评估分类结果。在5款开源软件中对近600多个克隆实例进行实验,实验结果表明所提方法为每个目标系统推荐克隆重构实例时达到80%的精度。
Aiming at long-term software maintenance even introduction of errors due to extensive use of cloned code, a classifier based on decision tree was proposed to recommend clone for refactoring. Firstly, clone detection was performed using NiCad. Secondly, the features related to cloning relationship, cloned code segment and clonal context were collected. Thirdly, a decision tree classifier was used for training. Finally, the classification results were evaluated by K-fold crossover. The experiments were conducted on nearly 600 clones in five kinds of open-source software. The experimental results show that the proposed method achieves 80% accuracy when recommending clonal refactoring instances for each target system.
作者
折蓉蓉
张丽萍
侯敏
闫盛
SHE Rongrong;ZHANG Liping;HOU Min;YAN Sheng(College of Computer and Information Engineering,Inner Mongolia Normal University,Hohhot Nei Mongol 010022,China)
出处
《计算机应用》
CSCD
北大核心
2018年第7期2037-2043,2069,共8页
journal of Computer Applications
基金
国家自然科学基金资助项目(61462071)
内蒙古自然科学基金资助项目(2016MS0612)~~
关键词
克隆代码
克隆重构
克隆检测
决策树
特征选择
code clone clone
refactoring clone detection decision tree feature
selection