计算机应用 ›› 2015, Vol. 35 ›› Issue (4): 1169-1173.DOI: 10.11772/j.issn.1001-9081.2015.04.1169

• 计算机软件技术 • 上一篇    下一篇

基于软件多版本演化提取克隆谱系

涂颖, 张丽萍, 王春晖, 侯敏, 刘东升   

  1. 内蒙古师范大学 计算机与信息工程学院, 呼和浩特 010022
  • 收稿日期:2014-11-15 修回日期:2014-12-24 出版日期:2015-04-10 发布日期:2015-04-08
  • 通讯作者: 刘东升
  • 作者简介:涂颖(1992-),女,江西九江人,硕士研究生,主要研究方向:软件分析; 张丽萍(1974-),女,内蒙古呼和浩特人,副教授,CCF会员,主要研究方向:软件工程、软件分析; 王春晖(1979-),女(蒙古族),内蒙古通辽人,讲师,硕士,CCF会员,主要研究方向:软件分析、多媒体、计算机辅助教学; 侯敏(1973-),女,内蒙古呼和浩特人,讲师,硕士,主要研究方向:软件分析、计算机教育; 刘东升(1956-),男,内蒙古呼和浩特人,教授,CCF会员,主要研究方向:软件工程、计算机教育、软件分析。
  • 基金资助:

    国家自然科学基金资助项目(61363017, 61462071);内蒙古自然科学基金资助项目(2014MS0613);内蒙古自治区高等学校科学研究项目(NJZY14039);内蒙古师范大学科学研究项目(2013ZRYB06)。

Clone genealogies extraction based on software evolution over multiple versions

TU Ying, ZHANG Liping, WANG Chunhui, HOU Min, LIU Dongsheng   

  1. College of Computer and Information Engineering, Inner Mongolia Normal University, Hohhot Nei Mongol 010022, China
  • Received:2014-11-15 Revised:2014-12-24 Online:2015-04-10 Published:2015-04-08

摘要:

针对单个版本克隆检测结果不足以体现克隆特征这一问题,从软件多版本中自动提取克隆谱系,获得克隆在软件演化过程中表现出的模式和特征。首先基于克隆代码Token表示及其所在文件名称、函数名称等位置属性,准确映射软件历时演化版本间的克隆代码,进而识别克隆演化模式;然后匹配克隆类ID号,合并所有相邻版本间的映射结果及演化模式信息,得到克隆谱系。同时开发了相应的克隆谱系自动提取工具FCG对6款开源软件进行了测试,发现当前版本中克隆代码平均生命周期占所研究版本总数的70%以上,且大部分没有发生变化,说明大部分克隆能被较好地维护,但也存在少量不稳定的克隆可能导致软件缺陷,需要修改或重构。实验结果表明FCG可高效提取克隆谱系,有助于更好地理解克隆及有针对性地管理克隆。

关键词: 克隆代码, 克隆谱系, 多版本, 克隆演化, 软件维护

Abstract:

Since clone detection results cannot fully reflect the features of clones, clone genealogies extraction from multiple versions can be used to uncover the patterns and characteristics exhibited by clones in the evolving system. A clone genealogy extraction method named FCG was proposed. FCG first mapped clones between each adjacent versions and then identified clone evolution patterns. All of the results were combined to get clone genealogies. Experiments on 6 open source systems found that the average lifetime of clones in current version is over 70 percent of the total number of studied versions, and most of them do not change, which indicates that majority of clones can be well maintained. While some unstable clones may be defect potential, and needs to be modified or refactoring. Results show that FCG can efficiently extract clone genealogies, which contributes to a better understanding of clones and provides insights on targeted management of clones.

Key words: clone code, clone genealogy, multi-version, clone evolution, software maintenance

中图分类号: