Neural-Based Test Oracle Generation: A Large-Scale Evaluation and Lessons Learned
Soneya Binta Hossain, Antonio Filieri, Matthew B. Dwyer, Sebastian G. Elbaum, Willem Visser
Abstract
Defining test oracles is crucial and central to test development, but manual construction of oracles is expensive. While recent neuralbased automated test oracle generation techniques have shown promise, their real-world effectiveness remains a compelling question requiring further exploration and understanding. This paper investigates the effectiveness of TOGA, a recently developed neuralbased method for automatic test oracle generation by Dinella et al.[16]. TOGA utilizes EvoSuite-generated test inputs and generates both exception and assertion oracles. In a Defects4j study, TOGA outperformed specification, search, and neural-based techniques, detecting 57 bugs, including 30 unique bugs not detected by other methods. To gain a deeper understanding of its applicability in real-world settings, we conducted a series of external, extended, and conceptual replication studies of TOGA.
In a large-scale study involving 25 real-world Java systems, 223.5K test cases, and 51K injected faults, we evaluate TOGA's ability to improve fault-detection effectiveness relative to the stateof-the-practice and the state-of-the-art. We find that TOGA misclassifies the type of oracle needed 24% of the time and that when it classifies correctly around 62% of the time it is not confident enough to generate any assertion oracle. When it does generate an assertion oracle, more than 47% of them are false positives, and the true positive assertions only increase fault detection by 0.3% relative to prior work. These findings expose limitations of the state-of-the-art neural-based oracle generation technique, provide valuable insights for improvement, and offer lessons for evaluating future automated oracle generation methods.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
9 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- TOGA: A Neural Method for Test Oracle Generation cites Evolutionary improvement of assertion oracles
- TOGA: A Neural Method for Test Oracle Generation cites On learning meaningful assert statements for unit test cases
- TOGA: A Neural Method for Test Oracle Generation cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- A Large-Scale Empirical Study on Fine-Tuning Large Language Models for Unit Testing cites TOGA: A Neural Method for Test Oracle Generation
- A Large-Scale Empirical Study on Fine-Tuning Large Language Models for Unit Testing cites On learning meaningful assert statements for unit test cases
- A Large-Scale Empirical Study on Fine-Tuning Large Language Models for Unit Testing cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- A Large-Scale Empirical Study on Fine-Tuning Large Language Models for Unit Testing cites TOGLL: Correct and Strong Test Oracle Generation with LLMS
- A Deep Dive into Large Language Models for Automated Bug Localization and Repair cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- TOGLL: Correct and Strong Test Oracle Generation with LLMS cites TOGA: A Neural Method for Test Oracle Generation
- TOGLL: Correct and Strong Test Oracle Generation with LLMS cites On learning meaningful assert statements for unit test cases
- TOGLL: Correct and Strong Test Oracle Generation with LLMS cites A Deep Dive into Large Language Models for Automated Bug Localization and Repair
- TOGLL: Correct and Strong Test Oracle Generation with LLMS cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Tratto: A Neuro-Symbolic Approach to Deriving Axiomatic Test Oracles cites Evolutionary improvement of assertion oracles
- Tratto: A Neuro-Symbolic Approach to Deriving Axiomatic Test Oracles cites TOGA: A Neural Method for Test Oracle Generation
- Tratto: A Neuro-Symbolic Approach to Deriving Axiomatic Test Oracles cites On learning meaningful assert statements for unit test cases
- Doc2OracLL: Investigating the Impact of Documentation on LLM-Based Test Oracle Generation cites TOGA: A Neural Method for Test Oracle Generation
- Doc2OracLL: Investigating the Impact of Documentation on LLM-Based Test Oracle Generation cites On learning meaningful assert statements for unit test cases
- Doc2OracLL: Investigating the Impact of Documentation on LLM-Based Test Oracle Generation cites A Deep Dive into Large Language Models for Automated Bug Localization and Repair
- Doc2OracLL: Investigating the Impact of Documentation on LLM-Based Test Oracle Generation cites TOGLL: Correct and Strong Test Oracle Generation with LLMS
Cited by top-tier papers9
- A Deep Dive into Large Language Models for Automated Bug Localization and RepairSoneya Binta Hossain, Nan Jiang, Qiang Zhou, Xiaopeng Li et al.FSE 2024 · 60 citations
- TOGLL: Correct and Strong Test Oracle Generation with LLMSSoneya Binta Hossain, Matthew B. DwyerICSE 2025 · 12 citations
- A Large-Scale Empirical Study on Fine-Tuning Large Language Models for Unit TestingYe Shang, Quanjun Zhang, Chunrong Fang, Siqi Gu et al.ISSTA 2025 · 7 citations
- Tratto: A Neuro-Symbolic Approach to Deriving Axiomatic Test OraclesDavide Molinelli, Alberto Martin-Lopez, Elliott Zackrone, Beyza Eken et al.ISSTA 2025 · 3 citations
- Doc2OracLL: Investigating the Impact of Documentation on LLM-Based Test Oracle GenerationSoneya Binta Hossain, Raygan Taylor, Matthew B. DwyerFSE 2025 · 3 citations
Builds on8
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- Directed Greybox FuzzingMarcel Böhme, Van-Thuan Pham, Manh-Dung Nguyen, Abhik RoychoudhuryCCS 2017 · 836 citations
- On learning meaningful assert statements for unit test casesCody Watson, Michele Tufano, Kevin Moran, Gabriele Bavota et al.ICSE 2020 · 96 citations
- TOGA: A Neural Method for Test Oracle GenerationElizabeth Dinella, Gabriel Ryan, Todd Mytkowicz, Shuvendu K. LahiriICSE 2022 · 92 citations
- Evolutionary improvement of assertion oraclesValerio Terragni, Gunel Jahangirova, Paolo Tonella, Mauro PezzèFSE 2020 · 50 citations
Related papers
- Towards More Realistic Evaluation for Neural Test Oracle GenerationZhongxin Liu, Kui Liu, Xin Xia, Xiaohu YangISSTA 2023 · 24 citations
- Do LLMs Generate Useful Test Oracles? An Empirical Study with an Unbiased DatasetDavide Molinelli, Luca Di Grazia, Alberto Martin-Lopez, Michael D. Ernst et al.ASE 2025 · 3 citations
- Perfect is the enemy of test oracleAli Reza Ibrahimzada, Yigit Varli, Dilara Tekinoglu, Reyhaneh JabbarvandFSE 2022 · 23 citations
- Effective Unit Test Generation for Java Null Pointer ExceptionsMyungho Lee, Jiseong Bak, Seokhyeon Moon, Yoonchan Jhi et al.ASE 2024 · 1 citation
- TerzoN: Human-in-the-Loop Software Testing with a Composite OracleMatthew C. Davis, Amy Wei, Brad A. Myers, Joshua SunshineFSE 2025 · 2 citations
