首页> 外文期刊>ACM transactions on software engineering and methodology >Multi-Criteria Code Refactoring Using Search-Based Software Engineering: An Industrial Case Study
【24h】

Multi-Criteria Code Refactoring Using Search-Based Software Engineering: An Industrial Case Study

机译:使用基于搜索的软件工程进行多准则代码重构:工业案例研究

获取原文

摘要

One of the most widely used techniques to improve the quality of existing software systems is refactoring-the process of improving the design of existing code by changing its internal structure without altering its external behavior. While it is important to suggest refactorings that improve the quality and structure of the system, many other criteria are also important to consider, such as reducing the number of code changes, preserving the semantics of the software design and not only its behavior, and maintaining consistency with the previously applied refactorings. In this article, we propose a multi-objective search-based approach for automating the recommendation of refactorings. The process aims at finding the optimal sequence of refactorings that (ⅰ) improves the quality by minimizing the number of design defects, (ⅱ) minimizes code changes required to fix those defects, (ⅲ) preserves design semantics, and (ⅳ) maximizes the consistency with the previously code changes. We evaluated the efficiency of our approach using a benchmark of six open-source systems, 11 different types of refactorings (move method, move field, pull up method, pull up field, push down method, push down field, inline class, move class, extract class, extract method, and extract interface) and six commonly occurring design defect types (blob, spaghetti code, functional decomposition, data class, shotgun surgery, and feature envy) through an empirical study conducted with experts. In addition, we performed an industrial validation of our technique, with 10 software engineers, on a large project provided by our industrial partner. We found that the proposed refactorings succeed in preserving the design coherence of the code, with an acceptable level of code change score while reusing knowledge from recorded refactorings applied in the past to similar contexts.
机译:改善现有软件系统质量的最广泛使用的技术之一是重构-通过更改其内部结构而不更改其外部行为来改进现有代码设计的过程。尽管建议进行重构以提高系统的质量和结构很重要,但许多其他标准也需要考虑,例如减少代码更改的数量,保留软件设计的语义(不仅是其行为)以及维护与先前应用的重构保持一致。在本文中,我们提出了一种基于多目标搜索的方法来自动进行重构建议。该过程旨在找到最佳的重构顺序,该重构顺序(ⅰ)通过最小化设计缺陷的数量来提高质量,(ⅱ)最小化修复这些缺陷所需的代码更改,(ⅲ)保留设计语义,并且(ⅳ)最大化重构。与以前的代码更改保持一致。我们使用六个开源系统,11种不同类型的重构(移动方法,移动字段,上拉方法,上拉字段,下推方法,下推字段,内联类,移动类)的基准评估了我们方法的效率通过与专家进行的经验研究,可以得出六种常见的设计缺陷类型(斑点,意大利面条代码,功能分解,数据类,shot弹枪手术和特征嫉妒),提取类,提取方法和提取接口。此外,我们与10位软件工程师一起在我们的工业合作伙伴提供的一个大型项目中对我们的技术进行了工业验证。我们发现,提出的重构成功地保留了代码的设计一致性,具有可接受的代码更改评分水平,同时重用了过去应用于类似上下文的记录的重构中的知识。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号