Automated batch refactoring has become a de-facto mechanism to restructure software that may have significant design flaws negatively impacting the code quality and maintainability. Although automated batch refactoring techniques are known to significantly improve overall software quality and maintainability, their impact on resource utilization is not well studied. This paper aims to bridge the gap between batch refactoring code smells and consumption of resources. It determines the relationship between software code smell batch refactoring, and resource consumption. Next, it aims to design algorithms to predict the impact of code smell refactoring on resource consumption. This paper investigates 16 code smell types and their joint effect on resource utilization for 31 open source applications. It provides a detailed empirical analysis of the change in application CPU and memory utilization after refactoring specific code smells in isolation and in batches. This analysis is then used to train regression algorithms to predict the impact of batch refactoring on CPU and memory utilization before making any refactoring decisions. Experimental results also show that our ANN-based regression model provides highly accurate predictions for the impact of batch refactoring on resource consumption. It allows the software developers to intelligently decide which code smells they should refactor jointly to achieve high code quality and maintainability without increasing the application resource utilization. This paper responds to the important and urgent need of software engineers across a broad range of software applications, who are looking to refactor code smells and at the same time improve resource consumption. Finally, it brings forward the concept of resource aware code smell refactoring to the most crucial software applications.
翻译:自动化批量重构已成为重构存在重大设计缺陷、对代码质量和可维护性产生负面影响的软件的事实标准机制。尽管已知自动化批量重构技术能显著提升整体软件质量和可维护性,但其对资源利用的影响尚未得到充分研究。本文旨在弥合批量重构代码异味与资源消耗之间的鸿沟,确定软件代码异味批量重构与资源消耗之间的关系,进而设计算法以预测代码异味重构对资源消耗的影响。本文研究了31个开源应用程序中16种代码异味类型及其对资源利用的联合效应,提供了对特定代码异味单独及批量重构后应用程序CPU和内存利用率变化的详细实证分析。随后,利用该分析训练回归算法,以在做出重构决策前预测批量重构对CPU和内存利用率的影响。实验结果表明,我们基于人工神经网络的回归模型能够高精度预测批量重构对资源消耗的影响,使软件开发人员能够智能地决定应联合重构哪些代码异味,以在提升代码质量和可维护性的同时避免增加应用程序资源利用率。本文回应了广泛软件应用领域软件工程师们对重构代码异味并同时改善资源消耗的重要且紧迫的需求,最终将资源感知的代码异味重构概念引入最关键的软件应用中。