A Tool for Generating Exceptional Behavior Tests With Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhong, Linghan, Yuan, Samuel, Zhang, Jiyang, Liu, Yu, Nie, Pengyu, Li, Junyi Jessy, Gligoric, Milos
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918037604532224
author Zhong, Linghan
Yuan, Samuel
Zhang, Jiyang
Liu, Yu
Nie, Pengyu
Li, Junyi Jessy
Gligoric, Milos
author_facet Zhong, Linghan
Yuan, Samuel
Zhang, Jiyang
Liu, Yu
Nie, Pengyu
Li, Junyi Jessy
Gligoric, Milos
contents 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).
format Preprint
id arxiv_https___arxiv_org_abs_2505_22818
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle 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
Software Engineering
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).
title A Tool for Generating Exceptional Behavior Tests With Large Language Models
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2505.22818