paperbot · PL 论文追踪

全部论文 待读 收藏

P2 TOGLL: Correct and Strong Test Oracle Generation with LLMS

TOGLL:使用LLM生成正确且强的测试预言
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 3/10 · 论文聚焦LLM生成测试预言(断言/异常),属于软件测试与动态分析,与用户核心的静态分析、形式化验证、浮点/贝叶斯程序分析等方向无直接关联;仅因使用LLM改进程序分析任务而存在弱关联。引用 18 inbox
Soneya Binta Hossain, Matthew B. Dwyer
crossref: 2026-09-12

AI 速览

一句话:首次大规模研究LLM生成测试预言,提出TOGLL,在正确性、多样性和缺陷检测上显著优于TOGA与EvoSuite。

测试预言对缺陷检测至关重要,但已有神经方法常误报多、预言强度弱;LLM在测试预言生成上缺乏大规模研究。本文在110个Java项目上,以六种提示微调七个代码LLM,选出最佳组合并提出TOGLL。作者在25个未见Java项目上评估泛化性,与EvoSuite和SOTA方法TOGA比较正确性、多样性和强度。结果显示,TOGLL生成的正确断言预言为TOGA的3.8倍、异常预言为4.9倍;检测到1,023个EvoSuite无法检测的唯一变异体,约为TOGA的十倍,并在Defects4J真实缺陷检测上显著优于TOGA。

问题
已有神经测试预言生成方法误报多、预言强度弱,且缺乏LLM在该任务上的大规模系统研究。
方法
在110个Java项目上以6种提示微调7个代码LLM,选最佳模型-提示组合构建TOGLL,并在25个未见项目上评估。
评估
与EvoSuite和TOGA比较,报告正确性、多样性、强度、变异体检测及Defects4J真实缺陷检测结果。
原文摘要(Abstract)

Test oracles play a crucial role in software testing, enabling effective bug detection. Despite initial promise, neural methods for automated test oracle generation often result in a large number of false positives and weaker test oracles. While LLMs have shown impressive effectiveness in various software engineering tasks, including code generation, test case creation, and bug fixing, there remains a notable absence of large-scale studies exploring their effectiveness in test oracle generation. The question of whether LLMs can address the challenges in effective oracle generation is both compelling and requires thorough investigation. In this research, we present the first comprehensive study to investigate the capabilities of LLMs in generating correct, diverse, and strong test oracles capable of effectively identifying a large number of unique bugs. To this end, we fine-tuned seven code LLMs using six distinct prompts on a large dataset consisting of 110 Java projects. Utilizing the most effective finetuned LLM and prompt pair, we introduce TOGLL, a novel LLM-based method for test oracle generation. To investigate the generalizability of TOGLL, we conduct studies on 25 unseen large-scale Java projects. Besides assessing the correctness, we also assess the diversity and strength of the generated oracles. We compare the results against EvoSuite and the state-of-the-art neural method, TOGA. Our findings reveal that TOGLL can produce 3.8 times more correct assertion oracles and 4.9 times more exception oracles than TOGA. Regarding bug detection effectiveness, TOGLL can detect 1,023 unique mutants that EvoSuite cannot, which is ten times more than what TOGA can detect. Additionally, TOGLL significantly outperforms TOGA in detecting real bugs from the Defects4J dataset.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8802,
  title = {TOGLL: Correct and Strong Test Oracle Generation with LLMS},
  author = {Soneya Binta Hossain and Matthew B. Dwyer},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00098}
}