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


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.


Software Behavioral Patterns;Energy Consumption;Energy Bad Smells;Code Refactoring


  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.
  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.
  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], 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.


Supported by : 한국연구재단