DOI QR코드

DOI QR Code

Code Refactoring Techniques Based on Energy Bad Smells for Reducing Energy Consumption

Energy Bad Smells 기반 소모전력 절감을 위한 코드 리팩토링 기법

  • 이제욱 (충북대학교 컴퓨터과학과) ;
  • 김두환 (충북대학교 컴퓨터과학과) ;
  • 홍장의 (충북대학교 컴퓨터과학과)
  • Received : 2016.01.12
  • Accepted : 2016.04.11
  • Published : 2016.05.31

Abstract

While the services of mobile devices like smart phone, tablet, and smart watch have been increased and varied, the software embedded into such devices has been also increased in size and functional complexity. Therefore, increasing operation time of mobile devices for serviceability became an important issue due to the limitation of battery power. Recent studies focus on the software development having efficient behavioral patterns because the energy consumption of mobile devices is caused by software behaviors which control the hardware operations. However, it is often difficult to develop the embedded software with considering energy-efficiency and behavior optimization due to the short development cycle of the mobile services in many cases. Therefore, this paper proposes the refactoring techniques for reducing energy consumption, and enables to fulfill the energy requirements during software development and maintenance. We defined energy bad smells with the code patterns that can excessively consume the energy, and our refactoring techniques are to remove these bad smells. We performed some case studies to verify the usefulness of our refactoring techniques.

최근 스마트폰, 태블릿과 같은 기기의 사용량이 증가하면서, 이에 탑재되는 소프트웨어는 더욱 복잡해지고 규모가 커지고 있다. 배터리의 전력으로 구동되는 모바일 기기들은 전력 공급의 한계로 인해 운용시간을 증가시키는 것이 중요한 이슈이다. 최근에는 소프트웨어 동작이 하드웨어 구동을 통해 전력 소모를 일으킨다는 점에서, 효율적인 동작 패턴을 갖는 소프트웨어 개발에 대한 연구들이 진행되고 있다. 그러나 모바일 기기에 탑재되는 소프트웨어는 그 개발 주기가 짧은 경우가 많아 최적화와 전력 소모량을 반영하기 어려운 경우가 많다. 따라서 본 연구에서는 소모전력 절감을 위한 코드 리팩토링 기법을 제안하여, 소프트웨어 개발 및 유지보수에서 보다 용이하게 저전력 요구사항을 충족시키고자 한다. 이를 위해 전력 소모량을 감소시킬 수 있는 코드 패턴에 대하여 Energy Bad Smell을 식별하고, 이를 제거하기 위한 새로운 코드 리팩토링 기법을 제안하며, 실험을 통해 그 효용성을 검증하였다.

Keywords

References

  1. Jang-Eui Hong and Doo-Hwan Kim, "Task Extraction from Software Design Models to Improve Energy Efficiency of Embedded Software," The KIPS Transactions: PartD, Vol.18D, No.1, pp.45-56, 2011. https://doi.org/10.3745/KIPSTD.2011.18D.1.045
  2. S. Hao, D. Li, W. G. Halfond, and R. Govindan, "Estimating mobile application energy consumption using program analysis," in Software Engineering (ICSE), 2013 35th International Conference on, IEEE, pp.92-101, 2013.
  3. T. K. Tan A. Raghunathan, and N. K. Jha, "Energy Macromodeling of Embedded Operating Systems," ACM Transactions on Embedded Computing Systems (TECS), Vol.4, No.1, pp.231-254, 2005. https://doi.org/10.1145/1053271.1053281
  4. H. Jun, L. Xuandong, Z. Guoliang, and W. Chenghua, "Modeling and Analysis of Power Consumption for Component-Based Embedded Software," Proc. Embedded Ubiquitous Computing Workshops 2006, pp.795-804, 2006.
  5. B. Nogueira, P. Maciel, E. Tavares, E. Andrade, R. Massa, G. Callou, and R. Ferraz, "A Formal Model for Performance and Energy Evaluation of Embedded Systems," EURASIP Journal on Embedded Systems, 2011.
  6. Brandolese, Carlo, et al., "The impact of source code transformations on software power and energy consumption," Proc. of Journal of Circuits, Systems, and Computers, 2002.
  7. J. Jelschen, et al., "Towards Applying Reengineering Services to Energy-Efficient Applications," Software Maintenance and Reengineering (SCMR), 16th European Conference on IEEE, 2012.
  8. D. Li, S. Hao, W. G. Halfond, and R. Govindan, "Calculating Source Line Level Energy Information for Android Applications," in Proceedings of the 2013 International Symposium on Software Testing and Analysis, pp.78-89, 2013.
  9. Y. W. Kwon and E. Tilevich, "Reducing the Energy Consumption of Mobile Applications Behind the Scenes," in Software Maintenance (ICSM), 2013 29th IEEE International Conference on, pp.170-179, 2013.
  10. M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts, "Refactoring: Improving the Design of Existing Code," Addison Wesley, 2002.
  11. Gottschalk, Marion, et al., "Removing Energy Code Smells with Reengineering Services," Proc. of GI-Jahrestagung, 2012.
  12. A. Banerjee, L. K. Chong, S. Chattopadhyay, and A. Roychoudhury, "Detecting Energy Bugs and Hotspots in Mobile Apps," in Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp.588-598, 2014.
  13. G. Pinto, F. Castor, and Y. D. Liu, "Understanding Energy Behaviors of Thread Management Constructs," Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, ACM, 2014.
  14. W. G. P. da Silva, L. Brisolara, U. B. Correa, and L. Carro, "Evaluation of the impact of code refactoring on embedded software efficiency," I Workshop de Sistemas Embarcados, 2010.
  15. R. Perez-Castillo and M. Piattini, "Analyzing the Harmful Effect of God Class Refactoring on Power consumption," IEEE Software, Vol.3, pp.48-54, 2014.
  16. J. J. Park, J. E. Hong, and S. H. Lee, "Investigation for Software Power Consumption of Code Refactoring Techniques," International Conference on Software Engineering & Knowledge Engineering, 2014.
  17. A. Pathak, Y. Charlie Hu, and M. Zhang, "Bootstrapping Energy Debugging on Smartphones: A First Look at Energy Bugs in Mobile Devices," in Hotnets'11, November, 2011.
  18. M. Gottschalk, J. Jelschen, and A. Winter, "Energy-Efficient Code by Refactoring," 15. Workshop Software-Reengineering, 2013.
  19. A. Vetro, L. Ardito, G. Procaccianti, and M. Morisio, "Definition, Implementation and Validation of Energy Code Smells: an exploratory study on an embedded system," in ENERGY 2013, The Third International Confrence on Smart Grids, Green Communications and IT Energy-aware Technologies, pp.34-39, 2013.
  20. Planet Source Code [Internet], https://www.planet-sourcecode.com/ available at April, 04, 2016.
  21. Z. Herczeg, D. Schmidt, and et al., "Eergy simulation of embedded XScale systems with XEEMU," Journal of Embedded Computing, Vol.3, No.3, pp.209-219, 2009.