摘要
随着软件不断迭代发展,软件维护成本也相应增加。自动化重构可以降低软件维护成本,基于搜索的重构方法是解决该问题最典型的方法之一。其中目标的选择对搜索过程起决定性作用,质量目标与非质量目标都是开发人员在重构时通常会考虑的目标。然而,尚未有研究系统地分析在相同的评价环境下,哪些目标更有利于代码重构,特别是得到符合开发者预期的代码重构结果;并且也未分析质量目标与常用的非质量目标进行组合是否会有更好的效果。文中提出了基于搜索的多目标软件重构方法,探索了7个不同目标的组合对软件重构质量的影响。在6个规模不同的开源软件项目上进行了验证,应用多种指标对重构前后软件质量进行评估,并分析了不同优化目标组合的表现。实验结果表明,质量目标与非质量目标组合比单独使用质量目标组合对重构效果的提升更明显,其中质量目标与之前重构记录的一致性的组合对重构有较好的提升效果。
The cost of software maintenance increases as the continuous iterative development of software.To reduce this cost,automated software refactoring is proven to be an effective solution.One of the most typical automated software refactoring approaches is the search-based refactoring.This approach refactors software according to some predefined objectives.Existing stu-dies show that the selection of objectives plays a decisive role in the search process.Although many quality objectives and non-quality objectives are proposed,there is no research to analyze that in the same evaluation framework which objectives can guide the software refactoring to achieve results that meet developers’expectations.Meanwhile,whether the combination of quality objectives and non-quality objectives will have better results is not analyzed.To answer these questions,this paper designs a search-based multi-objective software refactoring evaluation framework.Under the framework,this paper investigates the impact of the combination of seven different objectives on software refactoring with six open-source software projects in different scales;the software quality before and after refactoring is evaluated using a variety of indicators,and the effectiveness of different objective combinations is also analyzed.Experimental results show that the combination of quality objectives and non-quality objectives can better improve the effectiveness of software refactoring than using one single type of objectives,and the combination of the‘qua-lity’objective and the‘similarity with recorded code changes’objective is important to the improvement of software refactoring effectiveness.
作者
郭亚琳
李晓晨
任志磊
江贺
GUO Ya-lin;LI Xiao-chen;REN Zhi-lei;JIANG He(School of Software,Dalian University of Technology,Dalian,Liaoning 116600,China)
出处
《计算机科学》
CSCD
北大核心
2022年第11期55-64,共10页
Computer Science
基金
andJIANG He。
关键词
软件重构
多目标优化
软件质量
基于搜索的软件工程
软件维护
Software refactoring
Multi-objective optimization
Software quality
Search-based software engineering
Software maintenance