Test oracles play a crucial role in software testing, enabling effective bug detection. Despite initial promise, neural-based methods for automated test oracle generation often result in a large number of false positives and weaker test oracles. While LLMs have demonstrated 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 the SF110 dataset. Utilizing the most effective fine-tuned 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 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. Moreover, our findings demonstrate that TOGLL is capable of generating significantly diverse test oracles. It can detect 1,023 unique bugs that EvoSuite cannot, which is ten times more than what the previous SOTA neural-based method, TOGA, can detect.
Correct Tests Are Not Enough: Measuring and Training Oracle Conversion in Specification-Based Test Generation
Chengdu Institute of Computer Applications, Chinese Academy of Sciences(中国科学院成都计算机应用研究所);University of Chinese Academy of Sciences(中国科学院大学);Institute of Multidisciplinary Research for Advanced Materials (IMRAM), Tohoku University(东北大学先进材料多学科研究所);Artificial Intelligence Research Institute, Shenzhen University of Advanced Technology(深圳先进技术研究院人工智能研究所)
VISOR: A Vision-Language Model-based Test Oracle for Testing Robots
Simula Research Laboratory(Simula研究实验室);Oslo Metropolitan University(奥斯陆理工大学);Mondragon University(蒙dragon大学);National Institute of Informatics(国立信息研究所)
HistoryFinder: Advancing Method-Level Source Code History Generation with Accurate Oracles and Enhanced Algorithm
SQM Research Lab, University of Manitoba(马尼托巴大学 SQM 研究实验室);American International University-Bangladesh(孟加拉国美国国际大学);University of Saskatchewan(萨斯喀彻温大学)
Fault-Class-Matched Test Oracles for Output-Invisible Quantum Transpiler Regressions
City University of Science and Information Technology (CUSIT)(城市科学与技术大学);National University of Computer and Emerging Sciences (FAST-NUCES)(国家计算机与新兴科学大学)
LLM-Based Test Generation: Information Sources, Generation Strategies, and Quality Evidence
Chengdu Institute of Computer Applications, Chinese Academy of Sciences(中国科学院成都计算机应用研究所);University of Chinese Academy of Sciences(中国科学院大学);Institute of Multidisciplinary Research for Advanced Materials (IMRAM), Tohoku University(东北大学先进材料多学科研究所);Artificial Intelligence Research Institute, Shenzhen University of Advanced Technology(深圳先进技术研究院人工智能研究所)