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.
- Get started with publishing. http://developer.android.com/distribute/googleplay/start.html.Google Scholar
- Statista. http://www.statista.com/statistics/266210/number-of-available-applications-in-the-google-play-store.Google Scholar
- Monkeyrunner tool. http://developer.android.com/tools/help/MonkeyRunner.html.Google Scholar
- 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 ScholarDigital Library
- A. Banerjee, L. K. Chong, S. Chattopadhyay, and A. Roychoudhury. Detecting energy bugs and hotspots in mobile apps. In FSE, 2014. Google ScholarDigital Library
- F-droid. https://f-droid.org/.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- A. M. Memon, I. Banerjee, and A. Nagarajan. GUI ripping: Reverse engineering of graphical user interfaces for testing. In WCRE, 2003. Google ScholarDigital Library
- A. Machiry, R. Tahiliani, and M. Naik. Dynodroid: an input generation system for android apps. In ESEC/SIGSOFT FSE, 2013. Google ScholarDigital Library
- Hierarchy viewer. http://developer.android.com/tools/help/hierarchy-viewer.html.Google Scholar
- Greenery. https://github.com/ferno/greenery.Google Scholar
- Chessclock. https://f-droid.org/repository/browse/?fdfilter=chessclock.Google Scholar
- Sensorium. https://f-droid.org/repository/browse/?fdfilter=Sensorium&fdid=at.univie.sensorium.Google Scholar
- App category. https://play.google.com/store/apps/category/APPLICATION?hl=en.Google Scholar
- Apache lucene core. https://lucene.apache.org/core/.Google Scholar
- Userhash. https://f-droid.org/repository/browse/?fdfilter=Userhash&fdid=com.threedlite.userhash.location.Google Scholar
- Aripuca. https://f-droid.org/repository/browse/?fdid=com.aripuca.tracker.Google Scholar
- Sharemylocation. https://f-droid.org/repository/browse/?fdfilter=sharemyposition&fdid=net.sylvek.sharemyposition.Google Scholar
- Droidsat. https://f-droid.org/repository/browse/?fdfilter=droidsat&fdid=com.mkf.droidsat.Google Scholar
- Itlogger. https://f-droid.org/repository/browse/?fdfilter=itlogger&fdid=de.tui.itlogger.Google Scholar
- Heart rate monitor. https://f-droid.org/repository/browse/?fdfilter=heartrate&fdid=com.vanderbie.heart_rate_monitor.Google Scholar
- 0xbenchmark. https://f-droid.org/repository/browse/?fdid=org.zeroxlab.zeroxbenchmark.Google Scholar
- Ham. https://f-droid.org/repository/browse/?fdfilter=Ham&fdid=com.smerty.ham.Google Scholar
- Soot https://sable.github.io/soot/.Google Scholar
- 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 ScholarDigital Library
- Monsoon power monitor. https://www.msoon.com/LabEquipment/PowerMonitor/.Google Scholar
- Sensorium repository - github. https://github.com/fmetzger/android-sensorium.Google Scholar
- 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 ScholarDigital Library
- T. Hönig, C. Eibel, R. Kapitza, and W. Schröder-Preikschat. SEEP: exploiting symbolic execution for energy-aware programming. HotPower, 2011.Google ScholarDigital Library
- 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 ScholarDigital Library
- S. Hao, D. Li, W. G. J. Halfond, and R. Govindan. Estimating mobile application energy consumption using program analysis. In ICSE, 2013. Google ScholarDigital Library
- D. Li, S. Hao, W. G. J. Halfond, and R. Govindan. Calculating source line level energy information for android applications. In ISSTA, 2013. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Chaorong Guo, Jian Zhang, Jun Yan, Zhiqiang Zhang, and Yanli Zhang. Characterizing and detecting resource leaks in android applications. In ASE, 2013.Google ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- M. Cohen, H. S. Zhu, E. E. Senem, and Y. D. Liu. Energy types. In OOPSLA, 2012. Google ScholarDigital Library
- W. Baek and T. M. Chilimbi. Green: a framework for supporting energy-conscious programming using controlled approximation. In PLDI, 2010. Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
Index Terms
- Automated re-factoring of Android apps to enhance energy-efficiency
Recommendations
Debugging energy-efficiency related field failures in mobile apps
MOBILESoft '16: Proceedings of the International Conference on Mobile Software Engineering and SystemsDebugging field failures can be a challenging task for app-developers. Insufficient or unreliable information, improper assumptions and multitude of devices (smartphones) being used, are just some of the many factors that may contribute to its ...
Inter-app communication between Android apps developed in app-inventor and Android studio
MOBILESoft '16: Proceedings of the International Conference on Mobile Software Engineering and SystemsCommunications between mobile apps are an important aspect of mobile platforms. Android is specifically designed with inter-app communication in mind and depends on this to provide different platform specific functionalities. Android Apps can either be ...
Studying the consistency of star ratings and reviews of popular free hybrid Android and iOS apps
Nowadays, many developers make their mobile apps available on multiple platforms (e.g., Android and iOS). However, maintaining several versions of a cross-platform app that is built natively (i.e., using platform-specific tools) is a complicated task. ...
Comments