On the 14th December, Hina Anwar defended her PhD thesis on “Towards Greener Software Engineering Using Software Analytics”, which evaluates the energy impact of various code smell refactorings and third-party libraries used in Android apps. Based on the results, two tools, ARENA and REHAB, were developed to help developers and researchers improve the energy efficiency of Android apps.

Hina Anwar

Global warming due to CO2 emission has become one of the most prominent environmental issues. Many researchers in the ICT community are focusing on producing green and sustainable products and practices. In the current era, software systems are integrated into our lives due to the wide usage of portable devices such as smartphones.  Every year we see more and more software products and services focusing on mobile platforms, and as a result, the data created on the internet every minute is huge.  Every activity on our mobile devices comes with a small energy cost, contributing to CO2 emissions. Billions of people use mobile devices worldwide, and a small improvement in energy consumption of these devices could have a large impact collectively.

Since mobile devices are battery-operated, energy efficiency has become one of the crucial parameters when users select a device. The energy efficiency of a digital device has become part of its overall perceived quality. Mobile apps that do not drain battery usually get better ratings from users.  

To improve app code for energy efficiency, developers could apply refactoring alternatives that are energy efficient. Some refactoring guidelines and tools are available; however, these guidelines cannot be generalised w.r.t energy efficiency, as there is insufficient energy-related data for every context. Third-party libraries are used in app development to speed up the development process. Choosing a reliable third-party library is important as app success depends on it. However, if that third-party library is not energy efficient and will not be updated anytime soon, it might negatively impact battery consumption.

The term ‘Android development’ refers to the development of apps developed to operate on devices running the Android operating system. Unlike desktop or web applications, Android apps contain multiple components with user-driven workflows. A typical Android app consists of activities, fragments, services, content providers, and broadcast receivers.  Due to the difference in architecture, the support tools used to develop traditional Java-based applications are not useful in Android app development and maintenance.

In this thesis, Anwar’s research investigated 1) the energy impact of refactoring code smell types (first individually per type and then in permutations) on native Android open-source apps, 2)  the impact of third-party libraries on the energy consumption of Android applications. She conducted an empirical analysis of different code smells and third-party libraries. Based on the results, generalised contextual guidelines are provided that could be used during app development. Moreover, to identify what is lacking and possible future directions for research, this thesis presents a systematic mapping study that compares 51 existing support tools to develop energy-efficient Android apps. Based on the mapping study results and the contextual guidelines from empirical analysis, Anwar’s thesis developed two tools: ARENA (Analysing eneRgy Efficiency in aNdroid Apps) and REHAB (Recommending Energy-efficient tHird-pArty liBraries) to help developers and researchers improve the energy efficiency of their apps. Both tools are open-source and developed as a plugin for Android Studio and IntelliJ IDEs.

An overview of the energy measurement and analysis process supported by ARENA
An overview of REHAB arhicecture

DSpace