Static code analysis for reducing energy consumption in different loop types : a case study in Java
Gurung, Ram Prasad (2023)
Diplomityö
Gurung, Ram Prasad
2023
School of Engineering Science, Tietotekniikka
Kaikki oikeudet pidätetään.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi-fe2023080894298
https://urn.fi/URN:NBN:fi-fe2023080894298
Tiivistelmä
Background: An increase in ICT devices and services has led to a rise in carbon emissions. As a result, there is a growing demand for energy-efficient software; however, this demand remains unmet due to the lack of knowledge regarding the best practices for reducing energy consumption in software. Unnecessary iterations and faulty looping conditions in different loops can consume high energy, and loops are considered as one of the most energy consuming entities.
Aim: The purpose of this thesis is to detect and rectify energy code smells in different Java loop types by implementing static code analysis.
Method: Using the DSR approach, a Java Maven custom SonarQube plugin was developed. The plugin underwent in-house testing as well as evaluation by professionals. The professionals had provided feedback, which were later analyzed by using a qualitative method.
Results: For internal testing, 16 different open-source Java projects were selected. The results demonstrated considerable variations in the prevalence of energy code smells across the projects. Additionally, the plugin provided sample code suggestions to address each identified energy code smell. Finally, from the industry experts review, the plugin received an overall rating of Very Good.
Conclusion: The plugin had successfully detected code smells and suggested code samples to rectify the detected code smells. However, it cannot be overlooked that the plugin may also generate false positives.
Aim: The purpose of this thesis is to detect and rectify energy code smells in different Java loop types by implementing static code analysis.
Method: Using the DSR approach, a Java Maven custom SonarQube plugin was developed. The plugin underwent in-house testing as well as evaluation by professionals. The professionals had provided feedback, which were later analyzed by using a qualitative method.
Results: For internal testing, 16 different open-source Java projects were selected. The results demonstrated considerable variations in the prevalence of energy code smells across the projects. Additionally, the plugin provided sample code suggestions to address each identified energy code smell. Finally, from the industry experts review, the plugin received an overall rating of Very Good.
Conclusion: The plugin had successfully detected code smells and suggested code samples to rectify the detected code smells. However, it cannot be overlooked that the plugin may also generate false positives.
