logo

SCIENCE CHINA Information Sciences, Volume 61, Issue 5: 050103(2018) https://doi.org/10.1007/s11432-017-9400-y

NavyDroid: an efficient tool of energy inefficiency problem diagnosis for Android applications

Yi LIU1,2, Jue WANG1,2, Chang XU1,2,*, Xiaoxing MA1,2, Jian LU1,2
More info
  • ReceivedNov 29, 2017
  • AcceptedMar 27, 2018
  • PublishedApr 20, 2018

Abstract

Energy inefficiency is an influential non-functional issue for smartphone applications, causing increased concerns from users.Locating these problems is labor-intensive, thus automated diagnosis tools are in demand.Some existing approaches detect energy inefficiency problems by exploring application states with the JPF framework, and get favorable results.However, the effects of these approaches are restricted because of their imprecise application execution models and incomplete energy inefficiency patterns.This paper introduces NavyDroid, an effective and efficient tool of energy inefficiency problem diagnosis for Android applications.We constructed a comprehensive application execution model in the form of a state machine, which accurately simulates the runtime behavior of Android applications.We designed a parallel algorithm to systematically explore an application's state space.Our approach supports more energy inefficiency patterns, and is able to detect complicated wake lock misuses.We implemented our approach as a prototype tool and applied it to real-world applications.We evaluated NavyDroid with 19 real-world Android applications, and NavyDroid located more energy inefficiency bugs in these applications than the existing work E-GreenDroid did.Also, NavyDroid reduced the analysis time with its parallel state exploration algorithm.The experimental results demonstrated the effectiveness and efficiency of our approach for detecting energy inefficiency bugs in Android applications.


Acknowledgment

This work was supported in part by National Key Research and Development Program of China (Grant No. 2017YFB1001801) and National Natural Science Foundation of China (Grant Nos. 61690204, 61472174). The authors would also like to thank the support of the Collaborative Innovation Center of Novel Software Technology and Industrialization, Jiangsu, China.


References

[1] Pathak A, Jindal A, Hu Y C, et al. What is keeping my phone awake? characterizing and detecting no-sleep energy bugs in smartphone apps. In: Proceedings of the 10th International Conference on Mobile Systems, Applications, and Services, Low Wood Bay, 2012. 267--280. Google Scholar

[2] Zhang L D, Gordon M S, Dick R P, et al. Adel: an automatic detector of energy leaks for smartphone applications. In: Proceedings of the Eighth IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis, Tampere, 2012. 363--372. Google Scholar

[3] Li Q W, Xu C, Liu Y P. CyanDroid: stable and effective energy inefficiency diagnosis for Android apps. Sci China Inf Sci, 2017, 60: 012104 CrossRef Google Scholar

[4] Liu Y P, Xu C, Cheung S C. GreenDroid: automated diagnosis of energy inefficiency for smartphone applications. IEEE Trans Software Eng, 2014, 40: 911-940 CrossRef Google Scholar

[5] Wang J, Liu Y P, Xu C, et al. E-greendroid: effective energy inefficiency analysis for Android applications. In: Proceedings of the 8th Asia-Pacific Symposium on Internetware, Beijing, 2016. 71--80. Google Scholar

[6] Liu Y P, Wang J, Xu C, et al. NavyDroid: detecting energy inefficiency problems for smartphone applications. In: Proceedings of the 9th Asia-Pacific Symposium on Internetware, Shanghai, 2017. Google Scholar

[7] Liu Y P, Xu C, Cheung S C, et al. Understanding and detecting wake lock misuses for Android applications. In: Proceedings of the 24th ACM SIGSOFT International Symposium on the Foundations of Software Engineering, Seattle, 2016. 396--409. Google Scholar

[8] Liu Y P, Xu C, Cheung S C. Where has my battery gone? Finding sensor related energy black holes in smartphone applications. In: Proceedings of the IEEE International Conference on Pervasive Computing and Communications, San Diego, 2013. 2--10. Google Scholar

[9] Ma X, Huang P, Jin X X, et al. Edoctor: automatically diagnosing abnormal battery drain issues on smartphones. In: Proceedings of the 10th USENIX Conference on Networked Systems Design and Implementation, Lombard, 2013. 57--70. Google Scholar

[10] Manotas I, Pollock L, Clause J. SEEDS: a software engineers energy-optimization decision support framework. In: Proceedings of the 36th International Conference on Software Engineering, Hyderabad, 2014. 503--514. Google Scholar

[11] Li D, Lyu Y J, Gui J P, et al. Automated energy optimization of HTTP requests for mobile applications. In: Proceedings of the IEEE/ACM 38th International Conference on Software Engineering, Austin, 2016. 249--260. Google Scholar

[12] Li Y C, Guo Y, Kong J J, et al. Fixing sensor-related energy bugs through automated sensing policy instrumentation. In: Proceedings of the IEEE/ACM International Symposium on Low Power Electronics and Design, Rome, 2015. 321--326. Google Scholar

[13] Banerjee A, Chong L K, Ballabriga C, et al. Energypatch: repairing resource leaks to improve energy-efficiency of Android apps. IEEE Trans Softw Eng, 2017. doi: 10.1109/TSE.2017.2689012. Google Scholar

[14] Pathak A, Hu Y C, Zhang M. Where is the energy spent inside my app? Fine grained energy accounting on smartphones with eprof. In: Proceedings of the 7th ACM European Conference on Computer Systems, Bern, 2012. 29--42. Google Scholar

[15] Hao S, Li D, Halfond W G J, et al. Estimating mobile application energy consumption using program analysis. In: Proceedings of the 2013 International Conference on Software Engineering, San Francisco, 2013. 92--101. Google Scholar

[16] Li D, Hao S, Halfond W G J, et al. Calculating source line level energy information for Android applications. In: Proceedings of the 2013 International Symposium on Software Testing and Analysis, Lugano, 2013. 78--89. Google Scholar

[17] Banerjee A, Chong L K, Chattopadhyay S, et al. Detecting energy bugs and hotspots in mobile apps. In: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, Hong Kong, 2014. 588--598. Google Scholar

[18] Vekris P, Jhala R, Lerner S, et al. Towards verifying Android apps for the absence of no-sleep energy bugs. In: Proceedings of the 2012 USENIX Conference on Power-Aware Computing and Systems, Hollywood, 2012. 3. Google Scholar

[19] Wang X G, Li X F, Wen W. Wlcleaner: reducing energy waste caused by wakelock bugs at runtime. In: Proceedings of the 2014 IEEE 12th International Conference on Dependable, Autonomic and Secure Computing, Dalian, 2014. 429--434. Google Scholar

[20] Zhang L D, Tiwana B, Qian Z Y, et al. Accurate online power estimation and automatic battery behavior based power model generation for smartphones. In: Proceedings of the 2010 IEEE/ACM/IFIP International Conference on Hardware/Software Codesign and System Synthesis, Scottsdale, 2010. 105--114. Google Scholar

[21] Java pathfinder wiki page. https://babelfish.arc.nasa.gov/trac/jpf/wiki/intro/what_is_jpf 2017. Google Scholar

  • Figure 1

    (Color online) Motivating example from the TomaHawk application (revision 543c3b9ab4).

  • Figure 2

    (Color online) Approach overview.

  • Figure 3

    (Color online) State tree: the model of application states and event sequences.

  • Figure 4

    (Color online) NavyDroid AEM model (the activity part).

  • Figure 5

    (Color online) Use modes of (a) sensor listeners, (b) wake locks (not reference counted), and (c) wake locks (reference counted).

  • Figure 6

    (Color online) DUC value distribution bar charts. DUC values of (a) GPSLogger analyzed by E-GreenDroid, (b) GPSLogger analyzed by NavyDroid, (c) OsmDroid analyzed by E-GreenDroid, (d) OsmDroid analyzed by NavyDroid.

  • Figure 7

    Average execution time of sequential and parallel state exploration.

  • Figure 8

    (Color online) The trend of unrepeated event sequence number. (a) OmniDroid; (b) AndTweet.

  •   

    Algorithm 1 State exploration

    Require:Android application $A$.

    $Q~\leftarrow~\emptyset$;

    {empty queue;}

    $C_0~\leftarrow$ candidate event set of the initial state $s_0$;

    for all $e_0~\in~C_0$

    ${\rm~seq}_0~\leftarrow~[e_0]$;

    put ${\rm~seq}_0$ into $Q$;

    end for

    while $Q$ is not empty do

    ${\rm~seq}~\leftarrow$ take an element from $Q$;

    execute the application with ${\rm~seq}$, and reach state $s_k~=~\langle~A,~{\rm~seq}~\rangle$;

    if length(seq) $~<~$ bound then

    $C~\leftarrow$ candidate event set of $s_k$;

    for all $e_t~\in~C$

    ${\rm~seq}'~\leftarrow~{\rm~seq}+[e_t]$

    {append $e_t$ to the end of ${\rm~seq}$;}

    put ${\rm~seq}'$ into $Q$;

    end for

    end if

    end while

Copyright 2019 Science China Press Co., Ltd. 《中国科学》杂志社有限责任公司 版权所有

京ICP备18024590号-1