Energy Consumption Estimation of API-usage in Smartphone Apps via Static Analysis

Abdul Ali Bangash, Kalvin Eng, Qasim Jamal, Karim Ali, Abram Hindle

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

Smartphone application (app) developers measure the energy consumption of their apps to ensure that they do not consume excessive energy. However, existing techniques require developers to generate and execute test cases on expensive, sophisticated hardware. To address these challenges, we propose a static-analysis approach that estimates the energy consumption of API usage in an app, eliminating the need for test case execution. To instantiate our approach, we have profiled the energy consumption of the Swift SQLite API operations. Given a Swift app, we first scan it for uses of SQLite. We then combine that information with the measured energy profile to compute E-factor, an estimate of the energy consumption of the API usage in an app. To evaluate the usability of E-factor, we have calculated the E-factor of 56 real-world iOS apps. We have also compared the E-factor of 16 versions and 11 methods from 3 of those apps to their hardware-based energy measurements. Our findings show that E-factor positively correlates with the hardware-based energy measurements, indicating that E-factor is a practical estimate to compare the energy consumption difference in API usage across different versions of an app. Developers may also use E-factor to identify excessive energy-consuming methods in their apps and focus on optimizing them. Our approach is most useful in an Integrated Development Environment (IDE) or Continuous Integration (CI) pipeline, where developers receive energy consumption insights within milliseconds of making a code modification.

Original languageEnglish (US)
Title of host publicationProceedings - 2023 IEEE/ACM 20th International Conference on Mining Software Repositories, MSR 2023
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages272-283
Number of pages12
ISBN (Electronic)9798350311846
DOIs
StatePublished - 2023
Event20th IEEE/ACM International Conference on Mining Software Repositories, MSR 2023 - Melbourne, Australia
Duration: May 15 2023May 16 2023

Publication series

NameProceedings - 2023 IEEE/ACM 20th International Conference on Mining Software Repositories, MSR 2023

Conference

Conference20th IEEE/ACM International Conference on Mining Software Repositories, MSR 2023
Country/TerritoryAustralia
CityMelbourne
Period5/15/235/16/23

Keywords

  • Energy Estimation
  • Mobile Application
  • Static Analysis

ASJC Scopus subject areas

  • Software
  • Safety, Risk, Reliability and Quality

Fingerprint

Dive into the research topics of 'Energy Consumption Estimation of API-usage in Smartphone Apps via Static Analysis'. Together they form a unique fingerprint.

Cite this