21
0

A Tool for Generating Exceptional Behavior Tests With Large Language Models

Main:4 Pages
8 Figures
Bibliography:1 Pages
1 Tables
Abstract

Exceptional behavior tests (EBTs) are crucial in software development for verifying that code correctly handles unwanted events and throws appropriate exceptions. However, prior research has shown that developers often prioritize testing "happy paths", e.g., paths without unwanted events over exceptional scenarios. We present exLong, a framework that automatically generates EBTs to address this gap. exLong leverages a large language model (LLM) fine-tuned from CodeLlama and incorporates reasoning about exception-throwing traces, conditional expressions that guard throw statements, and non-exceptional behavior tests that execute similar traces. Our demonstration video illustrates how exLong can effectively assist developers in creating comprehensive EBTs for their project (available atthis https URL).

View on arXiv
@article{zhong2025_2505.22818,
  title={ A Tool for Generating Exceptional Behavior Tests With Large Language Models },
  author={ Linghan Zhong and Samuel Yuan and Jiyang Zhang and Yu Liu and Pengyu Nie and Junyi Jessy Li and Milos Gligoric },
  journal={arXiv preprint arXiv:2505.22818},
  year={ 2025 }
}
Comments on this paper