skip to main content
10.1145/2897073.2897086acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Automated re-factoring of Android apps to enhance energy-efficiency

Published:14 May 2016Publication History

ABSTRACT

Mobile devices, such as smartphones and tablets, are energy constrained by nature. Therefore, apps targeted for such platforms must be energy-efficient. However, due to the use of energy oblivious design practices often this is not the case. In this paper, we present a light-weight re-factoring technique that can assist in energy-aware app development. Our technique relies on a set of energy-efficiency guidelines that encodes the optimal usage of energy-intensive (hardware) resources in an app. Given a prototype for an app, our technique begins by generating a design-expression for it. A design-expression can be described as a regular-expression representing the ordering of energy-intensive resource usages and invocation of key functionalities (event-handlers) within the app. It also generates a set of defect-expressions, that are design-expressions representing the negation of energy-efficiency guidelines. A nonempty intersection between an app's design-expression and a defect-expression indicates violation of a guideline (and therefore, potential for re-factoring). To evaluate the efficacy of our re-factoring technique we analysed a suite of open-source Android apps using our technique. The resultant re-factoring when applied, reduced the energy-consumption of these apps between 3 % to 29 %. We also present a case study for one of our subject apps, that captures its design evolution over a period of two-years and more than 200 commits. Our framework found re-factoring opportunities in a number of these commits, that could have been implemented earlier on in the development stages had the developer used an energy-aware refactoring technique such as the one presented in this work.

References

  1. Get started with publishing. http://developer.android.com/distribute/googleplay/start.html.Google ScholarGoogle Scholar
  2. Statista. http://www.statista.com/statistics/266210/number-of-available-applications-in-the-google-play-store.Google ScholarGoogle Scholar
  3. Monkeyrunner tool. http://developer.android.com/tools/help/MonkeyRunner.html.Google ScholarGoogle Scholar
  4. A. Pathak, Y. C. Hu, and M. Zhang. Where is the energy spent inside my app?: fine grained energy accounting on smartphones with eprof. In EuroSys, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Banerjee, L. K. Chong, S. Chattopadhyay, and A. Roychoudhury. Detecting energy bugs and hotspots in mobile apps. In FSE, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. F-droid. https://f-droid.org/.Google ScholarGoogle Scholar
  7. Abhijeet Banerjee, Lee Kee Chong, Sudipta Chattopadhyay, and Abhik Roychoudhury. Detecting energy bugs and hotspots in mobile apps. In Proceedings of the 22Nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2014, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. J. E. Hopcroft, R. Motwani, and J. D. Ullman. Introduction to Automata Theory, Languages, and Computation (3rd Edition). Addison-Wesley Longman Publishing Co., Inc., 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. A. M. Memon, I. Banerjee, and A. Nagarajan. GUI ripping: Reverse engineering of graphical user interfaces for testing. In WCRE, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. Machiry, R. Tahiliani, and M. Naik. Dynodroid: an input generation system for android apps. In ESEC/SIGSOFT FSE, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Hierarchy viewer. http://developer.android.com/tools/help/hierarchy-viewer.html.Google ScholarGoogle Scholar
  12. Greenery. https://github.com/ferno/greenery.Google ScholarGoogle Scholar
  13. Chessclock. https://f-droid.org/repository/browse/?fdfilter=chessclock.Google ScholarGoogle Scholar
  14. Sensorium. https://f-droid.org/repository/browse/?fdfilter=Sensorium&fdid=at.univie.sensorium.Google ScholarGoogle Scholar
  15. App category. https://play.google.com/store/apps/category/APPLICATION?hl=en.Google ScholarGoogle Scholar
  16. Apache lucene core. https://lucene.apache.org/core/.Google ScholarGoogle Scholar
  17. Userhash. https://f-droid.org/repository/browse/?fdfilter=Userhash&fdid=com.threedlite.userhash.location.Google ScholarGoogle Scholar
  18. Aripuca. https://f-droid.org/repository/browse/?fdid=com.aripuca.tracker.Google ScholarGoogle Scholar
  19. Sharemylocation. https://f-droid.org/repository/browse/?fdfilter=sharemyposition&fdid=net.sylvek.sharemyposition.Google ScholarGoogle Scholar
  20. Droidsat. https://f-droid.org/repository/browse/?fdfilter=droidsat&fdid=com.mkf.droidsat.Google ScholarGoogle Scholar
  21. Itlogger. https://f-droid.org/repository/browse/?fdfilter=itlogger&fdid=de.tui.itlogger.Google ScholarGoogle Scholar
  22. Heart rate monitor. https://f-droid.org/repository/browse/?fdfilter=heartrate&fdid=com.vanderbie.heart_rate_monitor.Google ScholarGoogle Scholar
  23. 0xbenchmark. https://f-droid.org/repository/browse/?fdid=org.zeroxlab.zeroxbenchmark.Google ScholarGoogle Scholar
  24. Ham. https://f-droid.org/repository/browse/?fdfilter=Ham&fdid=com.smerty.ham.Google ScholarGoogle Scholar
  25. Soot https://sable.github.io/soot/.Google ScholarGoogle Scholar
  26. Rohan Padhye and Uday P. Khedker. Interprocedural data flow analysis in soot using value contexts. In Proceedings of the 2Nd ACM SIGPLAN International Workshop on State Of the Art in Java Program Analysis, SOAP '13, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Monsoon power monitor. https://www.msoon.com/LabEquipment/PowerMonitor/.Google ScholarGoogle Scholar
  28. Sensorium repository - github. https://github.com/fmetzger/android-sensorium.Google ScholarGoogle Scholar
  29. Lide Zhang, B. Tiwana, R. P. Dick, Zhiyun Qian, Z. M. Mao, Zhaoguang Wang, and Lei Yang. Accurate online power estimation and automatic battery behavior based power model generation for smartphones. In Hardware/Software Codesign and System Synthesis (CODES+ISSS), 2010 IEEE/ACM/IFIP International Conference on, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. T. Hönig, C. Eibel, R. Kapitza, and W. Schröder-Preikschat. SEEP: exploiting symbolic execution for energy-aware programming. HotPower, 2011.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. F. Qian, Z. Wang, A. Gerber, Z. M. Mao, S. Sen, and O. Spatscheck. Profiling resource usage for mobile applications: a cross-layer approach. In MobiSys, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. S. Hao, D. Li, W. G. J. Halfond, and R. Govindan. Estimating mobile application energy consumption using program analysis. In ICSE, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. D. Li, S. Hao, W. G. J. Halfond, and R. Govindan. Calculating source line level energy information for android applications. In ISSTA, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Yepang Liu, Chang Xu, and Shing-Chi Cheung. Characterizing and detecting performance bugs for smartphone applications. In Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Aaron Carroll and Gernot Heiser. An analysis of power consumption in a smartphone. In Proceedings of the 2010 USENIX Conference on USENIX Annual Technical Conference, USENIXATC'10, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Marius Marcu and Dacian Tudor. Energy consumption model for mobile wireless communication. In Proceedings of the 9th ACM International Symposium on Mobility Management and Wireless Access, MobiWac '11, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Mian Dong and Lin Zhong. Self-constructive high-rate system energy modeling for battery-powered mobile systems. In Proceedings of the 9th International Conference on Mobile Systems, Applications, and Services, MobiSys '11, pages 335--348, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Radhika Mittal, Aman Kansal, and Ranveer Chandra. Empowering developers to estimate app energy consumption. In Proceedings of the 18th Annual International Conference on Mobile Computing and Networking, Mobicom '12, pages 317--328, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Alex Shye, Benjamin Scholbrock, and Gokhan Memik. Into the wild: Studying real user activity patterns to guide power optimizations for mobile architectures. In Proceedings of the 42Nd Annual IEEE/ACM International Symposium on Microarchitecture, MICRO 42, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Denzil Ferreira, Anind K. Dey, and Vassilis Kostakos. Understanding human-smartphone concerns: A study of battery life. In Pervasive Computing, volume 6696, pages 19--33. Springer Berlin Heidelberg, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Abhinav Pathak, Y. Charlie Hu, Ming Zhang, Paramvir Bahl, and Yi-Min Wang. Fine-grained power modeling for smartphones using system call tracing. In Proceedings of the Sixth Conference on Computer Systems, EuroSys '11, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Jason Flinn and M. Satyanarayanan. Powerscope: A tool for profiling the energy usage of mobile applications. In Proceedings of the Second IEEE Workshop on Mobile Computer Systems and Applications, WMCSA '99, pages 2--, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. A. Pathak, A. Jindal, Y. C. Hu, and S. P. Midkiff. What is keeping my phone awake?: characterizing and detecting no-sleep energy bugs in smartphone apps. In MobiSys, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Chaorong Guo, Jian Zhang, Jun Yan, Zhiqiang Zhang, and Yanli Zhang. Characterizing and detecting resource leaks in android applications. In ASE, 2013.Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Y. Liu, C. Xu, S. C. Cheung, and J. Lu. Greendroid: Automated diagnosis of energy inefficiency for smartphone applications. Software Engineering, IEEE Transactions on, 2014.Google ScholarGoogle Scholar
  46. Yepang Liu, Chang Xu, and S. C. Cheung. Where has my battery gone? finding sensor related energy black holes in smartphone applications. In Pervasive Computing and Communications (PerCom), 2013 IEEE International Conference on, 2013.Google ScholarGoogle Scholar
  47. Adam J. Oliner, Anand P. Iyer, Ion Stoica, Eemil Lagerspetz, and Sasu Tarkoma. Carat: Collaborative energy diagnosis for mobile devices. In Proceedings of the 11th ACM Conference on Embedded Networked Sensor Systems, SenSys '13, pages 10:1--10:14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Lide Zhang, Mark S. Gordon, Robert P. Dick, Z. Morley Mao, Peter Dinda, and Lei Yang. 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, CODES+ISSS '12, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Abhijeet Banerjee, Hai-Feng Guo, and Abhik Roychoudhury. Debugging energy-efficiency related field failures in mobile apps. In IEEE/ACM International Conference on Mobile Software Engineering and Systems, MOBILESoft, 16, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. M. Cohen, H. S. Zhu, E. E. Senem, and Y. D. Liu. Energy types. In OOPSLA, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. W. Baek and T. M. Chilimbi. Green: a framework for supporting energy-conscious programming using controlled approximation. In PLDI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Irene Manotas, Lori Pollock, and James Clause. Seeds: A software engineer's energy-optimization decision support framework. In Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. A. Banerjee and A. Roychoudhury. Energy-aware design patterns for mobile application development (invited talk). In Proceedings of the 2Nd International Workshop on Software Development Lifecycle for Mobile, DeMobile 2014, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Adel Noureddine and Ajitha Rajan. Optimising energy consumption of design patterns. In Proceedings of the 37th International Conference on Software Engineering - Volume 2, ICSE '15, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. William Martin, Mark Harman, Yue Jia, Federica Sarro, and Yuanyuan Zhang. The app sampling problem for app store mining. In Proceedings of the 12th Working Conference on Mining Software Repositories, MSR '15, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automated re-factoring of Android apps to enhance energy-efficiency

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        MOBILESoft '16: Proceedings of the International Conference on Mobile Software Engineering and Systems
        May 2016
        326 pages
        ISBN:9781450341783
        DOI:10.1145/2897073

        Copyright © 2016 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 14 May 2016

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Upcoming Conference

        ICSE 2025

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader