A Tool for Generating Exceptional Behavior Tests With Large Language Models
Zhong, Linghan, Yuan, Samuel, Zhang, Jiyang, Liu, Yu, Nie, Pengyu, Li, Junyi Jessy, Gligoric, Milos
–arXiv.org Artificial Intelligence
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 at https://youtu.be/Jro8kMgplZk).
arXiv.org Artificial Intelligence
May-30-2025
- Country:
- Europe
- North America
- Canada (0.04)
- United States
- New York > New York County
- New York City (0.04)
- Texas > Travis County
- Austin (0.04)
- New York > New York County
- Genre:
- Research Report (1.00)
- Technology: