Understanding the Energy Impact of Software Refactoring: A Workload-Aware Study of Controlled Examples and Real-World Commits

📅 2026-08-06
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the lack of systematic understanding regarding the energy impact of software refactoring under diverse workloads, particularly the absence of empirical analysis linking real-world refactoring practices to energy regressions. The authors construct a microbenchmark encompassing 68 refactoring types and a practical benchmark comprising 481 real refactoring commits from GitHub. Leveraging multi-workload scenarios and repeated paired energy measurements, they conduct the first large-scale investigation revealing that the energy effects of refactoring are highly workload-sensitive. Their findings demonstrate that refactoring type alone is insufficient to predict energy changes: 51.8% of refactorings in the microbenchmark and 7.5% in real projects induce statistically significant energy differences. Execution time explains energy variation only in controlled settings. Moreover, existing metrics and large language model–based approaches prove unreliable for detecting energy regressions.
📝 Abstract
Refactoring improves software maintainability while preserving functional behavior, yet behavior preservation does not imply energy neutrality. Existing studies primarily examine isolated refactorings under fixed or simple workloads, leaving the effects of workload variation, real-world refactoring practices, explanatory factors, and energy regression identification insufficiently understood. We present the first large-scale empirical study of the energy impact of refactoring across two complementary Java benchmarks: a Micro-benchmark, comprising 68 refactoring types evaluated under diverse workloads, and a Practical-benchmark, containing 481 real-world refactoring commits from 430 GitHub projects. Using repeated paired energy measurements, we analyze workload sensitivity, refactoring patterns, explanatory factors, and the effectiveness of metric- and LLM-based regression identification. In the Micro-benchmark, 199 of 384 refactoring-workload pairs (51.8%) exhibit statistically significant energy differences, and 45.3% of refactoring instances change energy-impact classification across workloads. In the Practical-benchmark, only 36 commits (7.5%) show significant energy changes, although two-thirds differ by at least 10%. Refactoring type alone is insufficient to predict energy outcomes, while certain recurring refactoring combinations are associated with energy reductions. Changes in execution time consistently explain energy variation in the controlled benchmark but correlate weakly with energy changes in real-world commits. Our findings highlight the need for workload-diverse evaluation of the energy impact of refactoring; neither existing metric-based approaches nor LLM-based predictors can reliably identify refactoring-induced energy regressions, motivating the development of more accurate techniques for predicting the energy impact of refactoring.
Problem

Research questions and friction points this paper is trying to address.

energy impact
software refactoring
workload variation
energy regression
real-world commits
Innovation

Methods, ideas, or system contributions that make the work stand out.

energy-aware refactoring
workload-aware evaluation
empirical study
energy regression detection
software sustainability