SPELLing out energy leaks: Aiding developers locate energy inefficient code

Rui Pereira, Tiago Carção, Marco Couto, Jácome Cunha, João Paulo Fernandes, João Saraiva

Research output: Contribution to journalArticlepeer-review


Although hardware is generally seen as the main culprit for a computer's energy usage, software too has a tremendous impact on the energy spent. Unfortunately, there is still not enough support for software developers so they can make their code more energy-aware. This paper proposes a technique to detect energy inefficient fragments in the source code of a software system. Test cases are executed to obtain energy consumption measurements, and a statistical method, based on spectrum-based fault localization, is introduced to relate energy consumption to the source code. The result of our technique is an energy ranking of source code fragments pointing developers to possible energy leaks in their code. This technique was implemented in the SPELL toolkit. Finally, in order to evaluate our technique, we conducted an empirical study where we asked participants to optimize the energy efficiency of a software system using our tool, while also having two other groups using no tool assistance and a profiler, respectively. We showed statistical evidence that developers using our technique were able to improve the energy efficiency by 43% on average, and even out performing a profiler for energy optimization.

Original languageEnglish (US)
Article number110463
JournalJournal of Systems and Software
StatePublished - Mar 2020


  • Fault Localization
  • Green Computing
  • Green Software
  • Program Analysis
  • Program Optimization

ASJC Scopus subject areas

  • Software
  • Information Systems
  • Hardware and Architecture


Dive into the research topics of 'SPELLing out energy leaks: Aiding developers locate energy inefficient code'. Together they form a unique fingerprint.

Cite this