34
Software-Based Energy Profiling of Android Apps Simple, Efficient and Reliable? Andrea De Lucia Annibale Panichella Dario Di Nucci Fabio Palomba Andy Zaidman Antonio Prota

Software-Based Energy Profiling of Android Apps: Simple, Efficient and Reliable?

Embed Size (px)

Citation preview

Software-Based Energy Profiling of Android Apps

Simple, Efficient and Reliable?

Andrea De LuciaAnnibale Panichella

Dario Di Nucci Fabio Palomba

Andy Zaidman

Antonio Prota

Number of smartphone users worldwide from 2014 to 2020(in billions)

The statistics portal association.

IDC. Top 10 Smartphone Purchase Drivers.2014. IDC's ConsumerScape 360.

Top 10 Smartphone Purchase Drivers

Battery Life 56% 49% 53%

Ease of Use 33% 39% 38%

Operating System 37% 32% 40%

Touch Screen 34% 34% 37%

Screen Size 37% 22% 34%

Users complain about energy consumption of their apps.

Energy consumption affects user ratings on app stores.

Commercial apps do not have less problems than freely available applications.

Wilke et al. Energy consumption and efficiency in mobile applications: A user feedback study.2013. IEEE International Conference on Green Computing.

“(The faulty batteries were made) because we needed higher capacity batteries for the Note 7”

Koh Dong-jinSamsung’s mobile business chiefon Samsung Note 7 battery issue

“There is growing consensus that advances in battery technology and low-power circuit design cannot,

by themselves, meet the energy needsof future mobile computers”

Flinn and Satyanarayanan

Flinn and Satyanarayanan, Energy-aware adaptation for mobile applications.1999. ACM Symposium on Operating Systems Principles.

Lack of tools for quickly and efficiently measure the energy consumption of mobile applications

Harman et al. Achievements, open problems and challenges for search based software testing.2015. IEEE International Conference on Software Testing

Hardware-based tools Model-based tools Software-based tools

“Can SW-based tools lead to measurements close to HW-based oneswithout any cost overhead?”

Lack of tools for quickly and efficiently measure the energy consumption of mobile applications

Model-based tools Software-based tools

“Can SW-based tools lead to measurements close to HW-based oneswithout any cost overhead?”

Lack of tools for quickly and efficiently measure the energy consumption of mobile applications

Hardware-based tools

+ Best precision- Require specialized HW

and people- Sample frequency

problem

Hardware-based tools Model-based tools Software-based tools

+ Best precision- Require specialized HW

and people- Sample frequency

problem

“Can SW-based tools lead to measurements close to HW-based oneswithout any cost overhead?”

+ Not require HW- Less precise- Need careful parameters

calibration

Lack of tools for quickly and efficiently measure the energy consumption of mobile applications

Hardware-based tools Model-based tools Software-based tools

+ Best precision- Require specialized HW

and people- Sample frequency

problem

+ Not require HW- Less precise- Hawthorne effect

“Can SW-based tools lead to measurements close to HW-based oneswithout any cost overhead?”

+ Not require HW- Less precise- Need careful parameters

calibration

Lack of tools for quickly and efficiently measure the energy consumption of mobile applications

PETrA

Power Estimation Tool for Android

PETrAPower Estimation Tool for Android

Based on Project VoltaSelf-Modeling Paradigm*

Method Level Granularity

Minimize Hawthorne EffectStrong Integration with Android OS

Does not require any specialized HW

*Dong and Zhong. Self-constructive high-rate system energy modeling for battery-powered mobile systems. 2011. ACM International Conference on Mobile Systems, Applications, and Services.

PETrAWorkflow

Install App

Clear Environment

Exercise App

Compute Energy Consumptions

Save Results

More runs to perform?

Uninstall App

Smartphone Components Consumption Info

Powerprofile file

Smartphone Components State during a Time Frame

PETrAEnergy profile computation

Systrace

Batterystats

Active Methods during a Time Frame

dmtracedump

Energy Consumption for each Method Call

Empirical Evaluation

How close are the estimations from PETrAto a hardware-based tool?

Empirical Evaluation

RQ

54 apps*

Linares-Vasquez et al. Mining energy-greedy api usage patterns in android apps: An empirical study.2014. Working Conference on Mining Software Repositories.

Monsoon Toolkit* 414.899 API calls*321 APIs*

Context selection

Empirical Evaluation

*Linares-Vasquez et al. Mining energy-greedy api usage patterns in android apps: An empirical study.2014. Working Conference on Mining Software Repositories.

Test Environment Setup

LG Nexus 4* Monkeyrunner*

Data Analysis Metrics

10 runs

Empirical Evaluation

*Linares-Vasquez et al. Mining energy-greedy api usage patterns in android apps: An empirical study.2014. Working Conference on Mining Software Repositories.

Test Environment Setup

LG Nexus 4* Monkeyrunner*

Data Analysis Metrics

10 runs

Mean Magnitude Relative Error

MMRE

Empirical Evaluation

*Linares-Vasquez et al. Mining energy-greedy api usage patterns in android apps: An empirical study.2014. Working Conference on Mining Software Repositories.

Test Environment Setup

LG Nexus 4* Monkeyrunner*

Data Analysis Metrics

10 runs

Mean Magnitude Relative Error

MMRE

Relative Error Deviation within x

PRED(x)

Empirical Evaluation

*Linares-Vasquez et al. Mining energy-greedy api usage patterns in android apps: An empirical study.2014. Working Conference on Mining Software Repositories.

Test Environment Setup

LG Nexus 4* Monkeyrunner*

Data Analysis Metrics

10 runs

Mean Magnitude Relative Error

MMRE

Relative Error Deviation within x

PRED(x)

Ratio under/overestimations

Results

In 72% of apps MMRE is within 0.01.

In the worst case MMRE is 0.04

95% of method consumption estimations

are within 5% of error.

Results

89% of estimations are overestimations11% are underestimations

accumulated noise due to network usage

strong usage of sensors

Conclusioni

Conclusioni

Conclusioni

Conclusioni

Conclusioni

Conclusioni

Future works

Replicate on larger set of appsincluding not APIs methods.

Future works

Develop new techniques for providing better estimations.

Replicate on larger set of appsincluding not APIs methods.

Dario Di Nucci

University of Salerno

[email protected]

http://www.sesa.unisa.it/people/ddinucci/

Thanks for your attention!

Questions?

To what extent developers can handle energy related development issues?