From Code-Level Change to CI/CD Feedback: Empirical Validation of an Energy-Aware Software Framework
This study empirically validates an integrated energy-aware software framework by demonstrating that code-level interventions, CI/CD energy measurements, and regression detection can function together as a cohesive feedback loop to identify and localize energy inefficiencies in real-world Spring Boot applications.
Original paper licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
In the modern world, software runs on everything from the phones in our pockets to the massive data centers that power the internet. While we often think of energy consumption as a problem of hardware—of how much electricity a server or a battery uses—the software itself plays a massive role. Just as two different routes to the same destination can take different amounts of time and fuel, two different pieces of code that do the exact same job can draw very different amounts of power. When this software runs millions of times a day, those small differences add up to significant costs and carbon emissions. The challenge for developers has long been that this energy cost is invisible. When a programmer writes code, they receive immediate feedback on whether it works correctly or how fast it runs, but they receive no signal telling them if their change made the software more or less energy-efficient. This gap means that inefficient code often slips into production, where it continues to waste energy unnoticed.
A team of researchers at Lappeenranta-Lahti University of Technology in Finland set out to make this invisible energy visible within the very tools developers use every day. They tested a system designed to act as a feedback loop, connecting three distinct steps: making a change to the code, measuring the energy of that change automatically, and flagging any increase in energy use as a failure, much like a test that checks for bugs. To see if this worked in the real world, they applied their system to two open-source software applications and a standard automated testing pipeline. They did not just propose a new idea; they built it, ran it, and measured the results. Their work demonstrates that it is possible to catch energy waste the moment a developer submits a change, distinguishing between a genuine problem in the code and the normal, harmless fluctuations that happen when computers run on shared infrastructure.
The researchers began by testing whether specific changes to the code could actually be measured to show a difference in energy use. They selected two well-known software applications and introduced targeted changes to each. In the first application, they removed a redundant step where the software was looking up the same information twice in a database. In the second, they reorganized how the software retrieved articles, consolidating repeated steps into a single, cleaner process. They then ran the software's test suite twenty times for each version—ten times with the original code and ten times with the new code—on a dedicated machine to ensure a fair comparison. The results were clear. The first application showed a reduction in total energy use of approximately eight percent, while the second showed a reduction of over twenty-one percent. Crucially, the researchers found that these savings came primarily because the software finished its tasks faster, rather than because it drew less power at any single moment. This distinction is vital: the code was simply more efficient at getting the job done quickly, which naturally lowered the total energy consumed.
Having proven that code changes could be measured, the team moved to the next challenge: integrating this measurement into a live, automated workflow. They built a pipeline that runs every time a developer submits new code, a process known as continuous integration. This system measured energy at two levels. First, it looked at the entire test suite as a whole. Second, it measured the energy of individual requests, such as a single search or a single data retrieval, to see exactly where energy was being used. They found that on the shared computers used for these tests, the energy readings were surprisingly stable. The natural variation between runs was small enough that the system could reliably tell the difference between normal noise and a real problem. This stability allowed the system to set a baseline, or a standard of normal performance, against which every new piece of code could be compared.
The final test was to see if the system could catch a mistake. The researchers deliberately injected two types of energy-wasting errors into the code to see if the pipeline would flag them. In one scenario, they changed the code so that it asked the database for information one by one instead of all at once, a common error that causes massive inefficiency. In the other, they added a heavy computational task to just a few specific parts of the software. The system performed exactly as hoped. When the error affected the whole system, the pipeline flagged the entire build as a failure. When the error was localized to just a few specific features, the system correctly identified those specific features as the problem while letting the rest of the software pass. This ability to pinpoint the exact location of the waste is what makes the approach practical for developers, as it tells them exactly what to fix.
The study also highlighted the practical realities of using such a system. Because the computers running these tests are shared resources that can change over time, the system needed a way to adjust its standards. The researchers found that if the underlying computer hardware changed, the energy readings would shift dramatically, potentially causing false alarms. To solve this, their system includes a mechanism to automatically recalibrate its baseline whenever the code is successfully merged, ensuring that the standards always reflect the current environment. This prevents the system from blocking good code simply because the computer it is running on has changed. The researchers noted that while the system worked well in their controlled tests, the specific numbers they found—like the eight percent or twenty-one percent reductions—depend on the specific applications and the type of code changes made. They did not claim that every code change would save this much energy, but rather that the method of measuring and flagging these changes is viable.
Ultimately, this research provides a proof of concept that energy efficiency can be treated as a routine quality check, just like checking for bugs or performance speed. By making energy consumption visible and actionable within the development workflow, the system empowers developers to make informed decisions before their code is released. The study confirms that the three technical components—measuring the code, integrating the data into the pipeline, and detecting regressions—can work together as a single loop. While the researchers acknowledge that wider adoption will require further evaluation of how developers respond to these signals, the core finding is solid: it is possible to build a system that catches energy waste in real-time, turning an invisible problem into a manageable part of the software creation process.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.