TY - GEN
T1 - Energy Consumption Estimation of API-usage in Smartphone Apps via Static Analysis
AU - Bangash, Abdul Ali
AU - Eng, Kalvin
AU - Jamal, Qasim
AU - Ali, Karim
AU - Hindle, Abram
N1 - Publisher Copyright:
© 2023 IEEE.
PY - 2023
Y1 - 2023
N2 - 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.
AB - 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.
KW - Energy Estimation
KW - Mobile Application
KW - Static Analysis
UR - http://www.scopus.com/inward/record.url?scp=85166346131&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85166346131&partnerID=8YFLogxK
U2 - 10.1109/MSR59073.2023.00047
DO - 10.1109/MSR59073.2023.00047
M3 - Conference contribution
AN - SCOPUS:85166346131
T3 - Proceedings - 2023 IEEE/ACM 20th International Conference on Mining Software Repositories, MSR 2023
SP - 272
EP - 283
BT - Proceedings - 2023 IEEE/ACM 20th International Conference on Mining Software Repositories, MSR 2023
PB - Institute of Electrical and Electronics Engineers Inc.
T2 - 20th IEEE/ACM International Conference on Mining Software Repositories, MSR 2023
Y2 - 15 May 2023 through 16 May 2023
ER -