How Do Code Refactorings Affect Energy Usage?
Author : Sahin, Cagri; Pollock, Lori; Clause, James
Booktitle : International Symp on Empirical Software Engineering and Measurement (ESEM)
Date : Sep 2014
Publisher : ACM
Project : Green Software Engineering
Keyword(s) : code refactoring, energy usage, performance, measurement
Document Type : In Conference Proceedings
Context: Code refactoring’s bene ts to understandability, maintainability and extensibility are well known enough that automated support for refactoring is now common in IDEs. However, the decision to apply such transformations is currently performed without regard to the impacts of the refactorings on energy consumption. This is primarily due to a lack of information and tools to provide such relevant information to developers. Unfortunately, concerns about energy efficiency are rapidly becoming a high priority concern in many environments, including embedded systems, laptops, mobile devices, and data centers. Goal: We aim to address the lack of information about the energy efficiency impacts of code refactorings. Method: We conducted an empirical study to investigate the energy impacts of 197 applications of 6 commonly-used refactorings. Results: We found that refactorings can not only impact energy usage but can also increase and decrease the amount of energy used by an application. In addition, we also show that metrics commonly believed to correlate with energy usage are unlikely to be able to fully predict the impact of applying a refactoring. Conclusion: The results from this and similar studies could be used to augment IDEs to help software developers build more energy efficient software.