Skip to main navigation Skip to search Skip to main content

Can LLMs Make Software Testing Greener? An Empirical Study on JUnit Test Energy Reengineering

Research output: Chapter in Book/Conference proceedings/Edited volume › Conference contribution › Scientific › peer-review

4 Downloads (Pure)

Abstract

Software testing is essential to ensure the reliability of software. To that end, test suites are often executed repeatedly, due to frequent developer validation runs, and practices like continuous integration. This repeated execution leads to substantial energy consumption and thus potential environmental impact. In this paper, we conduct an exploratory study to examine whether current Large Language Models (LLMs) are capable of reengineering unit tests to improve their energy efficiency while maintaining test effectiveness. Our results indicate that, using a straightforward prompt, only a small subset of unit tests shows improved energy efficiency, with negligible impact on test effectiveness. Subsequently, we scrutinize our results for potential reasons for the relatively low number of energy-reengineered unit tests. We observe that energy efficiency related information is scarce on prominent platforms like StackOverflow and GitHub. This scarcity of information potentially affects how LLMs can be trained on the topic of energy efficiency.
Original languageEnglish
Title of host publicationFSE Companion 2026 - Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering
EditorsShin Hwei Tan, Foutse Khomh
Place of PublicationNew York, NY
PublisherAssociation for Computing Machinery (ACM)
Pages1529-1538
Number of pages10
ISBN (Electronic)9798400726361
DOIs
Publication statusPublished - 2026
EventACM International Conference on the Foundations of Software Engineering, FSE 2026 - Montreal, Canada
Duration: 5 Jul 2026 → 9 Jul 2026

Conference

ConferenceACM International Conference on the Foundations of Software Engineering, FSE 2026
Country/TerritoryCanada
CityMontreal
Period5/07/26 → 9/07/26

UN SDGs

This output contributes to the following UN Sustainable Development Goals (SDGs)

  1. SDG 7 - Affordable and Clean Energy
    SDG 7 Affordable and Clean Energy

Keywords

  • energy measurement
  • green testing
  • sustainable software engineering

Fingerprint

Dive into the research topics of 'Can LLMs Make Software Testing Greener? An Empirical Study on JUnit Test Energy Reengineering'. Together they form a unique fingerprint.

Cite this