Large Language Models (LLMs) have shown tremendous promise in automated software engineering. In this paper, we investigate the opportunities of LLMs for just-in-time regression test generation for programs, like parsers, interpreters, or compilers, that take highly structured, human-readable inputs. When a new bug fix or code change is committed, the repository (as part of the CI/CD workflow) runs an LLM for a few minutes to generate regression test cases for that commit that exercise the changed code and potentially trigger any bugs.
Specifically, we investigate LLM-based regression test generation as a \emph{machine translation task} that takes the developer-provided commit message, the code change, and the name of the input format (e.g., XML) and produces regression test cases for the described change in the given input format. In our experiments testing 46 commits to Mujs, Libxml2, Poppler, JerryScript, Z3, and PHP, our feedback-directed, zero-shot LLM-based prototype Cleverest performed unexpectedly well, even if we did \emph{not} provide the code change. In under 2 minutes, on average, Cleverest found more bugs than the state-of-the-art directed greybox fuzzer WAFLGo in 24 hours, even though WAFLGo started with a commit-reaching seed corpus in the majority of cases. If we amplify the Cleverest-generated test cases using those as a seed corpus in coverage-guided greybox fuzzing, the number of bugs found almost doubles. We call the integration with fuzzing as ClevFuzz.
In addition, we found that some commit messages are more expressive than others, thus we wonder how this impacts the effectiveness of Cleverest. Our results above demonstrate that Cleverest picks up on the change intention. For instance, if the commit message describes that this patch changes how floating point variables are treated in the MuJS JavaScript interpreter, then Cleverest generates JavaScript programs that contain floating point variables. To study the impact of expressiveness, we change the commit messages minimally to reduce and increase the information in the commit message, respectively, and find a substantial impact on effectiveness. For instance, adding 18 words on average (max. 46) to make ineffective commit messages more expressive almost doubled the number of bugs found.
| slides (main.pdf) | 2.38MiB |
Tue 7 JulDisplayed time zone: Eastern Time (US & Canada) change
16:00 - 17:30 | Test generation 2Tool Demonstrations / Journal-First Paper / Research Papers at MB 5.215 Chair(s): Ezekiel Soremekun Singapore University of Technology and Design | ||
16:00 20mTalk | Failing with Purpose: Dangling Coverage-Guided Negative Test Generation from a Mechanized P4 Type System Research Papers | ||
16:20 10mTalk | Argus: A Guided and Traceable Mutation Testing Engine Tool Demonstrations Zi Yang University of California, Riverside, Zhaorui Yang University of California, Riverside, Jiyuan Wang Tulane University, Qian Zhang University of California at Riverside | ||
16:30 20mTalk | Evaluating LLM-based Regression Test Generation Research Papers Jing Liu Max Planck Institute for Security and Privacy, Seongmin Lee UCLA, Eleonora Losiouk University of Padua, Marcel Böhme MPI for Security and Privacy DOI Pre-print File Attached | ||
16:50 20mTalk | TestLoop: A Process Model Describing Human-in-the-Loop Software Test Suite Generation Journal-First Paper Matthew C. Davis Carnegie Mellon University, Sangheon Choi Rose-Hulman Institute of Technology, Amy Wei University of Michigan, Sam Estep Carnegie Mellon University, Brad A. Myers Carnegie Mellon University, Joshua Sunshine Carnegie Mellon University Link to publication DOI | ||
17:10 20mTalk | MR-Coupler: Automated Metamorphic Test Generation via Functional Coupling Analysis Research Papers Congying Xu The Hong Kong University of Science and Technology, China, Hengcheng Zhu The Hong Kong University of Science and Technology, Songqiang Chen The Hong Kong University of Science and Technology, Jiarong Wu , Valerio Terragni University of Auckland, Shing-Chi Cheung Hong Kong University of Science and Technology Pre-print | ||