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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
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)
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)
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)
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)
Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Boston (2018)
Kwon, Y., Lee, Z., Park, Y.: Performance-based refactoring: identifying & extracting move-method region. J. KIISE: Softw. Appl. 40(10), 567–574 (2013)
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)
Gottschalk, M., Jelschen, J., Winter, A.: Saving energy on mobile devices by refactoring. In: EnviroInfo, pp. 437–444 (2014)
Park, J.J., Hong, J.E., Lee, S.H.: Investigation for software power consumption of code refactoring techniques. In: SEKE, pp. 717–722 (2014)
Gottschalk, M., Josefiok, M., Jelschen, J., Winter, A.: Removing energy code smells with reengineering services. GI-Jahrestagung 208, 441–455 (2012)
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)
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)
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)
Gottschalk, M., Jelschen, J., Winter, A.: Energy-efficient code by refactoring. Softwaretechnik-Trends 33(2), 23–24 (2013)
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)
Borghetti, S., Gianfagna, L., Sgro, A.M.: U.S. Patent No. 8,145,918. U.S. Patent and Trademark Office, Washington, DC (2012)
Intel power gadget: https://software.intel.com/en-us/articles/intel-power-gadget-20. Accessed 10 Feb 2019
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)
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)
LocMetrics. http://www.locmetrics.com/index.html. Accessed 15 Dec 2018
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)
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)
GitHub. https://github.com/postman721/Calculator. Accessed 12 Mar 2019
Pinto, G., Castor, F., Liu, Y.D.: Understanding energy behaviors of thread management constructs. ACM SIGPLAN Not. 49(10), 345–360 (2014)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
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
DOI: https://doi.org/10.1007/978-3-030-36178-5_12
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-36177-8
Online ISBN: 978-3-030-36178-5
eBook Packages: Intelligent Technologies and RoboticsIntelligent Technologies and Robotics (R0)