摘要
以具有嵌套结构的克隆代码为研究对象,使用NiCad检测工具获取克隆代码的检测结果,然后将检测出的克隆代码转换为抽象语法树,利用递归函数返回最优子树,筛选出具有相同嵌套结构的克隆代码;再利用最优映射算法对具有相同嵌套结构的克隆对进行映射.此方法更好地支持了Type-3类型克隆代码的映射,为进一步研究克隆代码重构奠定了基础.
Taking the clone code with a nested structure as an object of the study,the research gets results of clone code by the detection tool of NiCad.Then,the clone code is transferred to an abstract syntax tree.Using the recursive function,the optimal subtree is returned,and the clone code which has the same nested structure is selected out.Finally,the optimal mapping algorithm is used to map the clone pair which has the same nested structure.This method supports the mapping of Type-3 clone code better,and lays a foundation for further research on clone code refactoring.
作者
赵凤荣
姚永婷
张丽萍
赵俊奇
ZHAO Feng-rong;YAO Yong-ting;ZHANG Li-ping;ZHAO Jun-qi(College of Computer and Information Engineering,Inner Mongolia Normal University,Hohhot 010022,China;China United Network Communications Group Co.,Ltd Inner Mongolia Autonomous Region Branch,Hohhot 010050,China)
出处
《内蒙古大学学报(自然科学版)》
CAS
北大核心
2018年第5期521-527,共7页
Journal of Inner Mongolia University:Natural Science Edition
基金
国家自然科学基金资助项目(61462071)
内蒙古自然科学基金资助项目(2018MS06009)
内蒙古师范大学科研基金项目(2016ZRYB003)
关键词
克隆代码
克隆映射
抽象语法树
最优映射算法
clone code
clone mapping
abstract syntax tree
optimal mapping algorithm