paperbot · PL 论文追踪

全部论文 待读 收藏

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

LLM 能让软件测试更绿色吗?JUnit 测试能源重构的实证研究
FSE Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering2026匹配度 3/10 · 论文研究 LLM 重写 JUnit 测试以降低能耗,属于软件测试与 LLM 应用领域,但与用户核心关注的静态分析、形式化验证、浮点/贝叶斯程序分析等方向无直接关联;虽涉及 LLM 作为工具且问题驱动,但任务场景不符。引用 0 inbox
Xutong Liu, Andy Zaidman
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:实证研究 LLM 能否重写 JUnit 单元测试以降低能耗,同时保持测试有效性。

软件测试对保障可靠性至关重要,但由于开发者频繁验证与持续集成等实践,测试套件常被反复执行,带来可观的能耗与环境影响。本文开展一项探索性实证研究,考察当前大语言模型(LLM)能否对单元测试进行重构,在维持测试有效性的前提下提升其能源效率。作者采用直接提示的方式,让 LLM 对 JUnit 单元测试进行能源重构,并测量重构前后的能耗与测试有效性。结果显示,仅有小部分单元测试实现了能源效率提升,且对测试有效性的影响可以忽略。随后,作者进一步分析了能源重构测试数量偏少的潜在原因,发现 StackOverflow、GitHub 等主流平台上与能源效率相关的信息较为稀缺,这种信息匮乏可能影响 LLM 在该主题上的训练效果。

问题
测试套件因频繁验证与持续集成而被反复执行,造成大量能耗,但目前尚不清楚 LLM 能否在保持测试有效性的同时重写单元测试以降低能耗。
方法
开展探索性实证研究,使用直接提示让 LLM 对 JUnit 单元测试进行能源重构,并对比重构前后的能耗与测试有效性,同时分析 StackOverflow 和 GitHub 上能源效率相关信息的稀缺程度。
评估
通过测量单元测试在重构前后的能源效率变化与测试有效性变化来评估 LLM 的重构效果,并统计主流平台中能源效率相关信息的可获得性以解释结果。结果表明仅少量单元测试获得能耗改善,且对测试有效性影响可忽略。
原文摘要(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.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{LiuZ26,
  title = {Can LLMs Make Software Testing Greener? An Empirical Study on JUnit Test Energy Reengineering},
  author = {Xutong Liu and Andy Zaidman},
  booktitle = {FSE},
  year = {2026},
  doi = {10.1145/3803437.3805600}
}