arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.11086cs.SEcs.AI
收藏

基于大语言模型的回归测试生成评估

Evaluating LLM-Based Regression Test Generation

MPI-SP(Max Planck Institute for Software Process Engineering);University of California at Los Angeles(加州大学洛杉矶分校);University of Padua(帕多瓦大学)

Jing Liu, Seongmin Lee, Eleonora Losiouk, Marcel Böhme

AI总结:

研究利用大语言模型为特定程序即时生成回归测试,将其作为机器翻译任务,通过对多个项目测试,反馈导向的零样本原型Cleverest表现良好,还探讨了提交消息对其效果的影响。

摘要:

大语言模型在自动化软件工程中展现出巨大潜力。本文研究大语言模型用于为诸如解析器、解释器或编译器等处理高度结构化、人类可读输入的程序进行即时回归测试生成。当提交错误修复或代码更改时,仓库运行大语言模型几分钟以生成回归测试。我们将基于大语言模型的回归测试生成框架化为机器翻译任务……

英文摘要:

Large Language Models (LLMs) have shown tremendous promise in automated software engineering. In this paper, we investigate LLMs for just-in-time regression test generation for programs, like parsers, interpreters, or compilers, that take highly structured, human-readable inputs. When a bug fix or code change is committed, the repository (as part of CI/CD) runs an LLM for a few minutes to generate regression tests that exercise the changed code and potentially trigger bugs. We frame LLM-based regression test generation as a machine translation task that takes the developer-provided commit message, the code change, and the input format name (e.g., XML), and produces regression tests for the described change in that format. Testing 72 commits to Mujs, Libxml2, Poppler, JerryScript, Z3, PHP, JQ, and MicroPython, our feedback-directed, zero-shot prototype Cleverest performed well, even without the code change. In under 2 minutes on average, Cleverest found as many bugs as the state-of-the-art directed greybox fuzzer WAFLGo did in 24 hours, even though WAFLGo started with a commit-reaching seed corpus in most cases. Using the Cleverest-generated tests as a seed corpus in coverage-guided greybox fuzzing doubles the number of bugs found; we call this integration ClevFuzz. We also find that some commit messages are more expressive than others, thus we ask how it impacts Cleverest's effectiveness. Cleverest picks up on the change intention: e.g., given a commit message that a patch changes how floating point variables are treated in the Mujs JavaScript interpreter, Cleverest generates JavaScript programs that contain floating point variables. Minimally changing commit messages to reduce or increase their information substantially impacts effectiveness: adding 17 words on average (max. 43) to make ineffective commit messages more expressive significantly increased the number of bugs found.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑