Green Software Lab


Green Software Laboratory

This page presents the main results of the Green Software Lab – Laboratory research project (slides and final report). This was a project funded by Fundação para a Ciencia e Tecnologia – FCT: the Portuguese research foundation, under reference FCOMP-01-0124-FEDER-010048, that ran from January 2016 till July 2020.



All the publications produced in the context of the project are available in the publications page of the project’s website.


All the developed software in the context of the project is available in the tools page of the project’s website.


Project Activities

  • The three “CO” (Composability, Comprehensibility, Correctness) Winter School (Kosice, Slovakia – January 22-26, 2018)
  • Collaboration with Prof. Patrícia Lago in the organization of the GREENS Workshop co-located with ICSE 2018
  • Keynote talk by Prof. João Saraiva: “Energyaware analysis” at the 7th Workshop on Software Quality Analysis, Monitoring, Improvement, and Applications (SQAMIA), Novi Sad, Serbia, 2018
  • 1 week visit from Prof. Joost Visser, Radboud University, The Netherlands
  • Invited talk by Prof. Joost Visser, Radboud University, The Netherlands: “Green Software Research by SIG” at the 2nd GSL Workshop, Braga, 29th October 2018
  • 1 week visit from Prof. Zoltán Porkolab, Eotvos Lorand University, Budapest, Hungary
  • Invited talk by Prof. Zoltan Porkolab, Eotvos Lorand University, Budapest, Hungary,: “Save the Earth, program in C++!” at the 3rd GSL Workshop, Coimbra, 10th May of 2019
  • Central European Functional Programming Summer School (Budapest, Hungary – June 17-21, 2019)
  • Two tutorials on Energy-Aware Software: “Paint your Programs Green – On the Energy Efficiency of Data Structure Implementations” and “Green Software in an Engineering Course” at the Central European Functional Programming School (CEFP) (Budapest, Hungary, 2019)
  • Keynote talk by Prof. João Paulo Fernandes: “Ranking Programming Languages for their Energy Efficiency” at the 8th Symposium on Languages, Applications and Technologies (SLATE 2019) (Coimbra, June 27-28, 2019)
  • Prof. João Saraiva was a member of the panel “Software Energy Efficiency: When Academia Meets Industry at the Eleventh international Green and sustainable computing (IGSC’20) conference (October 2020)


First GSL Workshop

The first workshop was organized by João Paulo Fernandes at Universidade da Beira Interior in Covilhã on 20th January of 2017. The first GSL workshop was structured in two sessions: the morning session included presentations reporting results already achieved in the project. In the afternoon we had a brainstorming session, discussing open problems, how to organize future work, and the collaboration between the four sites of the project. All members of the project attended this single workshop.


10:30Green Cloud ModelJoost Visser
11:30Project OverviewJoão Saraiva
12:00Software Repositories for Green ComputingJoão Paulo Fernandes
13:30Modeling the Impact of UAVs in SustainabilityJosé María Conejero
14:00The LARA Language in the Context of JavaTiago Carvalho
14:30Performance-based Guidelines for Energy-efficient Mobile ApplicationsLuís Cruz
15:00Coffee Break
15:15Static Energy Consumption Analysis in Variability SystemsMarco Couto
15:45Haskell in the Green LandGilberto Melfe
16:15European ProjectsJácome Cunha

Second GSL Workshop

The second workshop was organized by João Saraiva at Universidade do Minho in Braga on 29th October of 2018. This workshop coincide with the PhD defense of the team member Rui Pereira. Thus, the program of the workshop started with a morning session consisting of Rui’s PhD defense. The project’s consultant Prof. Joost Visser, Radboud University, The Netherlands, was the main opponent in the PhD defense, and started the afternoon session with an invited talk with title “Green Software Research by SIG”. After this talk, members of team gave talks where they presented their ongoing results. The workshop finished with a brainstorming session chaired by Dr. Rui Pereira.


10:00 – 13:00PhD Defense:
Energyware Engineering-Techniques and Tools for Green Software Development
Rui Pereira (MAPi – HASLab, Univ. Minho)
José Nuno Oliveira (Minho Univ., chair)
Joost Visser (Radboud Univ. & SIG, NL)
João Cardoso (Porto Univ.)
Rui Maranhão (Lisbon Univ.)
Grabriel David (Porto Univ.)
Orlando Belo (Minho Univ.)
João Saraiva (Minho Univ.)
13:00 – 15:00Lunch Break
15:00 – 15:10“The GSL Project: Goals and Results”João Saraiva (HASLab, Univ. Minho)
15:10 – 16:00“Green Software Research by SIG”
“Building Maintainable Software”
Joost Visser (Radboud Univ. + SIG, NL)
16:00 – 16:10Coffee Break
16:10 – 16:30“GreenHub – Introducing Phase 2”Hugo Matalonga, João Paulo Fernandes (CISUC, Univ. Coimbra)
16:30 – 16:50“GreenSource – Repository Tailored for Green Software Analysis”Rui Rua (MAPi – HASLab, Univ. Minho)
16:50 – 17:10“Java Stream Fusion”Francisco Ribeiro (MAPi – HASLab, Univ. Minho)
17:10 – 17:30“Modeling the Energy Impact of Android Bad Programming Patterns”Marco Couto (MAPi – HASLab, Univ. Minho)
17:30 – 17:50“jStanley: placing a green thumb on Java collections”Jácome Cunha (NOVA LINCS, Univ. Minho)
17:50 – 18:00Closing sessionRui Pereira (HASLab, Univ. Minho)

Third GSL Workshop

The fourth workshop was organized by João Paulo Fernandes at Universidade de Coimbra on 10th May of 2019. This workshop started with an invited talk by Prof. Zoltan Porkolab, Eotvos Lorand University, Budapest, Hungary, with title “Save the Earth, program in C++!”, followed by sessions with presentations reporting results achieved in the project. The members of the project and several staff members of the Universidade de Coimbra attended the workshop.


10:00 – 10:30GreenSource: a large-scale collection of Android code, tests and energy metricsRui Rua
10:30 – 11:00Energy Refactorings for Android in the Large and in the WildMarco Couto
11:00 – 11:30Coffe Break
11:30 – 12:00Do energy-oriented changes hinder code maintainability?Luís Cruz
12:00 – 12:30How to mix water and oil?Zoltán Porkoláb
12:30 – 13:00Alice in Green Land: How did we get here and where do we go from here?João Saraiva
13:00 – 14:15Lunch
14:15 – 15:15Save the Earth, Program in C++!Zoltán Porkoláb
15:15 – 15:45Source-to-source Compilation for Instrumentation and Code TransformationsJoão Bispo e Pedro Pinto
15:45 – 16:15GreenHub Farmer: Real-world data for Android Energy MiningHugo Matalonga
16:15 – 16:45Towards a Catalog for Energy SmellsFrancisco Ribeiro
16:45 – 17:00Closing SessionClosing Session

Empirical Studies

Spell Empirical Study

We have conducted a large study with 20 software developers to validate the Spectrum-based Energy Leak Localization (SPELL). The results achieved confirm that our technique indeed help programmers locating abnormal energy consumption in software systems. These results are documented in Energyware Engineering: Techniques and Tools for Green Software Development and Spelling out energy leaks: Aiding developers locate energy inefficient code.

Refactoring Energy Patterns

We developed an extensible, fully automated framework called Chimera, which is able to detect and refactor energy-greedy programming patterns. Chimera also measures the energy consumed by an application in different simulated usage scenarios, before and after refactoring. This tool was used to process and successfully refactor hundreds of Android applications. This work was published at the SANER conference and is also part of Marco Couto’s PhD thesis.

GreenSource and AnaDroid

In order to provide a suitable and uniform setting for evaluating software analysis and optimization techniques in the Android ecosystem, we developed the GreenSource infrastructure: a large body of open source Android applications tailored for energy analysis and optimization. GreenSource consists of three main components: (1) a large collection of open source, executable Android applications, (2) a benchmarking framework, called AnaDroid, to test such applications under different usage scenarios and collect structural and energy-related metrics, and (3) a large scale repository of metrics obtained from executing the applications using AnaDroid. These results obtained with these artifacts are documented in this page, as well in the paper GreenSource: a Large-Scale collection of Android Code, Tests and Energy Metrics and in Rui Rua’s MsC thesis.

Greenspecting Android Virtual Keyboards

We performed two empirical studies showing that there exist relevant performance differences among the most used keyboards, and it is possible to save nearly 18% of energy by replacing the most used keyboard in Android by the most efficient one. We also showed that is possible to save both energy and time by disabling keyboard intrinsic features and hat the use of word suggestions not always compensate for energy and time. The results were presented in Greenspecting Android Virtual Keyboards.


The GreenHub initiative follows a novel initiative to analyze the energy consumption of android applications: it uses a collaborative approach where android users are invited to install this Android app, that monitors the energy consumption of the devices in a normal environment. The GreenHub app stores all measurements in the GreenHub database, which is then analyzed using data mining techniques to reason about which API, hardware, settings, etc may influence the consumption of an android device. This initiative already attracted thousands of collaborators and the media attention, with the size of this initiative and its data collected constantly growing. The results regarding its adoption and collected data and can be consulted on the tool page.


  • Antena 1: “90 segundos de ciência- GreenHub: Este projeto quer ajudá-lo a poupar a bateria do seu smartphone” (2018)
  • Antena 1: “Ponto de Partida – As baterias do futuro” (2018)