Energy CodeSumption, Leveraging Test Execution for Source Code Energy Consumption Analysis

Published in Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering (FSE Companion ’25), 2025

Paper, DOI, Replication Package, Slides

Abstract

The software engineering community has increasingly recognized sustainability as a key research area. However, developers often have limited knowledge of effective strategies to reduce software energy consumption. To address this, we analyze energy consumption in software execution, aiming to raise developer awareness by linking energy consumption with each line of code. We rely on unit test executions to identify energy-intensive executions and manually analyze five hot and five cold spots to identify potentially energy-intensive source code constructs. Our findings suggest a link between the energy consumption of the source code and the number of objects’ attributes created within that code. These results lay the groundwork for further analysis of the relationship between object instantiation and energy consumption in Java.