Skip to main content

Investigating the Impact of Code Refactoring Techniques on Energy Consumption in Different Object-Oriented Programming Languages

  • Conference paper
  • First Online:
Artificial Intelligence and Applied Mathematics in Engineering Problems (ICAIAME 2019)

Abstract

Code refactoring techniques that are used to improve the properties of the code such as readability, performance, maintenance are applied to the code depending on the type of coding. However, these techniques could increase energy consumption that this case can be considered as a hint for re-arranging them. This article includes an empirical experiment that investigates the effect of refactoring techniques energy consumption. C#, Java, and C++ are selected as experimental object-oriented languages. The individual effects of the five different code refactoring techniques are examined on similar applications coded with three different languages. The power consumption profiling tool namely Intel Power Gadget is used for measuring energy consumption of original and refactored codes. The findings of the analysis provide new insights into how a refactoring technique affects energy consumption with regard to the type of programming language.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Agarwal, S., Nath, A., Chowdhury, D.: Sustainable approaches and good practices in green software engineering. Int. J. Res. Rev. Comput. Sci. 3(1), 1425–1428 (2012)

    Google Scholar 

  2. Manotas, I., Bird, C., Zhang, R., Shepherd, D., Jaspan, C., Sadowski, C., Clause, J.: An empirical study of practitioners’ perspectives on green software engineering. In: 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE), pp. 237–248. IEEE (2016)

    Google Scholar 

  3. Shenoy, S.S., Eeratta, R.: Green software development model: an approach towards sustainable software development. In: 2011 Annual IEEE India Conference (INDICON), pp. 1–6. IEEE (2011)

    Google Scholar 

  4. Hsu, C.H., Kremer, U.: The design, implementation, and evaluation of a compiler algorithm for CPU energy reduction. ACM SIGPLAN Not. 38(5), 38–48 (2003)

    Article  Google Scholar 

  5. Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Boston (2018)

    MATH  Google Scholar 

  6. Kwon, Y., Lee, Z., Park, Y.: Performance-based refactoring: identifying & extracting move-method region. J. KIISE: Softw. Appl. 40(10), 567–574 (2013)

    Google Scholar 

  7. Park, J.J., Hong, J.E.: An approach to improve software safety by code refactoring. In: Proceedings of Korea Computer Congress, pp. 532–534 (2013)

    Google Scholar 

  8. Gottschalk, M., Jelschen, J., Winter, A.: Saving energy on mobile devices by refactoring. In: EnviroInfo, pp. 437–444 (2014)

    Google Scholar 

  9. Park, J.J., Hong, J.E., Lee, S.H.: Investigation for software power consumption of code refactoring techniques. In: SEKE, pp. 717–722 (2014)

    Google Scholar 

  10. Gottschalk, M., Josefiok, M., Jelschen, J., Winter, A.: Removing energy code smells with reengineering services. GI-Jahrestagung 208, 441–455 (2012)

    Google Scholar 

  11. Palomba, F., Di Nucci, D., Panichella, A., Zaidman, A., De Lucia, A.: On the impact of code smells on the energy consumption of mobile applications. Inf. Softw. Technol. 105, 43–55 (2019)

    Article  Google Scholar 

  12. da Silva, W.G.P., Brisolara, L., Correa, U.B., Carro, L.: Evaluation of the impact of code refactoring on embedded software efficiency. In: Workshop de Sistemas Embarcados (2010)

    Google Scholar 

  13. Sahin, C., Pollock, L., Clause, J.: From benchmarks to real apps: exploring the energy impacts of performance-directed changes. J. Syst. Softw. 117, 307–316 (2016)

    Article  Google Scholar 

  14. Gottschalk, M., Jelschen, J., Winter, A.: Energy-efficient code by refactoring. Softwaretechnik-Trends 33(2), 23–24 (2013)

    Google Scholar 

  15. Bessa, T., Gull, C., Quintão, P., Frank, M., Nacif, J., Pereira, F.M.Q.: JetsonLEAP: a framework to measure power on a heterogeneous system-on-a-chip device. Sci. Comput. Program. 173, 21–36 (2017)

    Article  Google Scholar 

  16. Borghetti, S., Gianfagna, L., Sgro, A.M.: U.S. Patent No. 8,145,918. U.S. Patent and Trademark Office, Washington, DC (2012)

    Google Scholar 

  17. Intel power gadget: https://software.intel.com/en-us/articles/intel-power-gadget-20. Accessed 10 Feb 2019

  18. Papadopoulos, L., Marantos, C., Digkas, G., Ampatzoglou, A., Chatzigeorgiou, A., Soudris, D.: Interrelations between software quality metrics, performance and energy consumption in embedded applications. In: Proceedings of the 21st International Workshop on Software and Compilers for Embedded Systems, pp. 62–65. ACM (2018)

    Google Scholar 

  19. Kim, D., Hong, J.E., Yoon, I., Lee, S.H.: Code refactoring techniques for reducing energy consumption in embedded computing environment. Clust. Comput. 21(1), 1079–1095 (2018)

    Google Scholar 

  20. LocMetrics. http://www.locmetrics.com/index.html. Accessed 15 Dec 2018

  21. Banerjee, A., Chong, L.K., Chattopadhyay, S., Roychoudhury, A.: 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. ACM (2014)

    Google Scholar 

  22. Sahin, C., Tornquist, P., Mckenna, R., Pearson, Z., Clause, J.: How does code obfuscation impact energy usage? In: 2014 IEEE International Conference on Software Maintenance and Evolution, pp. 131–140. IEEE (2014)

    Google Scholar 

  23. GitHub. https://github.com/postman721/Calculator. Accessed 12 Mar 2019

  24. Pinto, G., Castor, F., Liu, Y.D.: Understanding energy behaviors of thread management constructs. ACM SIGPLAN Not. 49(10), 345–360 (2014)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ibrahim Sanlialp .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Sanlialp, I., Ozturk, M.M. (2020). Investigating the Impact of Code Refactoring Techniques on Energy Consumption in Different Object-Oriented Programming Languages. In: Hemanth, D., Kose, U. (eds) Artificial Intelligence and Applied Mathematics in Engineering Problems. ICAIAME 2019. Lecture Notes on Data Engineering and Communications Technologies, vol 43. Springer, Cham. https://doi.org/10.1007/978-3-030-36178-5_12

Download citation

Publish with us

Policies and ethics