摘要
现有克隆代码重构研究局限于单一版本的静态分析,忽略了克隆代码的演化过程,这导致在克隆代码重构决策方面缺乏有效的方法。因此文中首先从克隆检测、克隆映射、克隆家系以及软件维护日志管理系统中提取与克隆代码密切相关的演化历史信息;其次识别出需要重构的克隆代码,同时识别出跟踪的克隆代码,然后提取与重构相关的静态特征和演化特征,并构建特征样本数据库;最后对比多种机器学习的方法对,选出效果最佳的分类器推荐重构克隆。在7款软件近170个版本上进行的实验表明,推荐重构克隆代码的准确度达到90%以上,这为软件开发和维护人员提供了更加准确、合理的代码重构建议。
The research on the existing clone code reconstruction is limited to a single version of static analysis while ignoring the evolution process of the cloned code,resulting in a lack of effective methods for reconstructing the cloned code.Therefore,this paper firstly extracted the evolution history information closely related to the clone code from clone detection,clone mapping,clone family and software maintenance log management system.Secondly,the clone code that needs to be reconstructed was identified,and the traced clone code was identified at the same time.Then,static features and evolution features were extracted and reconstructed and a feature sample database was built.Finally,a variety of machine learning methods were used to compare and select the best classifier recommended reconstruction of clones.In this paper,experiments were performed on nearly 170 versions of 7 software.The results show that the readiness for reconstructing cloned code is more than 90%.It provides more accurate and reasonable code reconstruction suggestions for software development and maintenance personnel.
作者
折蓉蓉
张丽萍
SHE Rong-rong;ZHANG Li-ping(College of Computer and Information Engineering,Inner Mongolia Normal University,Hohhot 010022,China)
出处
《计算机科学》
CSCD
北大核心
2019年第8期224-232,共9页
Computer Science
基金
国家自然科学基金资助项目(61462071)
内蒙古自然科学基金资助项目(2018MS06009)
内蒙古教育厅资助项目(NJZY17049)
内蒙古师范大学科研基金项目(2016ZRYB003)资助
关键词
克隆代码
克隆重构
克隆跟踪
克隆家系
特征提取
Code clone
Clone refactoring
Clone tracking
Clone family
Feature extraction