Evolution of Kotlin Apps in terms of Energy Consumption: An Exploratory Study - Ahmed, Hesham; Boshchenko, Alina; Khan, Niaz Ali; Knyajev, Dmitriy; Garifollina, Dinara; Scoccia, Gian Luca; Martinez, Matias; Malavolta, Ivano (2023 International Conference on ICT for Sustainability (ICT4S), 2023)
Context. Java and Kotlin are the two main programming languages used to create Android applications. Kotlin almost completely replicates the capabilities offered by Java and offers extra features, making it a popular choice among developers. From a sustainability perspective, it is crucial to assess the energy usage of Kotlin-based Android applications. Goal. The goal of this study is to explore how the energy consumption of Kotlin applications evolves over time. The study also aims at identifying the key factors that influence energy consumption, to inform developers on how the changes they make affect the energy consumed by their applications. Method. To investigate how Kotlin apps' energy consumption changes through releases, we study three open-source apps Kotlin apps that are also present in the Google Play store. We conduct a measurement-based experiment during which we assess the energy consumed by several releases of each studied application, for a total of 171 executions. Afterwards, we statistically analyse the collected data to identify relevant energy fluctuations (i.e.,, spikes, drops). Finally, we manually inspect the source code changes in the apps to identify possible causes of the identified energy fluctuations. Results. All three studied applications exhibit a growing trend for energy consumption over the course of their releases. Moreover, abnormal energy spikes are found for all applications. There are different causes behind these variations, including OS upgrades, new features, poorly chosen design patterns and libraries, UI issues, and unstable app versions. Conclusions. Our study provides evidence that a number of not fully understood factors can affect the energy consumption of a mobile application. Further work is needed to study their impact.