计算机科学与探索 ›› 2012, Vol. 6 ›› Issue (6): 513-521.DOI: 10.3778/j.issn.1673-9418.2012.06.004

• 学术研究 • 上一篇    下一篇

使用程序聚类技术的模块重构风险分析方法

朱天梅,吴毅坚+,彭  鑫,赵文耘   

  1. 复旦大学 计算机科学技术学院 软件工程实验室,上海 201203
  • 出版日期:2012-06-01 发布日期:2012-06-01

Measuring the Refactoring Risk of Modules Using Software Clustering

ZHU Tianmei, WU Yijian+, PENG Xin, ZHAO Wenyun   

  1. Software Engineering Laboratory, School of Computer Science, Fudan University, Shanghai 201203, China
  • Online:2012-06-01 Published:2012-06-01

摘要: 随着软件系统的演化,其模块化结构会逐渐退化。软件重构是调整系统结构的重要手段,但哪些模块最需要重构却难以预测。提出了一种基于程序聚类技术的模块重构风险分析方法,该方法通过对目标系统进行结构聚类和语义聚类获得其参考模块化结构,然后比较现实模块化结构与参考模块化结构之间的差异,对程序模块的设计质量进行评价,识别出系统中重构风险较高的模块。实验以三个开源软件的演化历史作为研究对象,与传统的模块化度量方法进行了比较,结果表明采用所提方法获得的预测结果与实际重构活动有较好的吻合度,从而验证了该方法的有效性。

关键词: 重构风险, 软件模块化, 程序聚类, 软件度量, 软件质量

Abstract: As software evolves, its modularity gradually degrades. Software refactoring is an important means for software modularity adjustment, but which modules are most in need of refactoring is difficult to predict. This paper proposes a novel approach for measuring the refactoring risk of modules by software clustering. Using structural clustering and semantic clustering, two different kinds of implied modularity views can be recovered from the implementation as reference modularity. By comparing the differences between the realistic modular structure and the reference modular structure, modules with high refactoring risk are identified. A comparative experiment conducted on three open source softwares shows that the predicting result produced by the proposed approach conforms well to the actual refactoring activities, indicating the effectiveness of the proposed approach.

Key words: refactoring risk, software modularity, software clustering, software metrics, software quality