MultiFileTest:一个多文件级LLM单元测试生成基准及错误修复机制的影响
MultiFileTest: A Multi-File-Level LLM Unit Test Generation Benchmark and Impact of Error Fixing Mechanisms
AI总结:
本文提出MultiFileTest基准,评估多文件级代码的单元测试生成性能,发现前沿LLM表现一般,且存在执行及级联错误,进一步评估了错误修复机制的效果。
摘要:
单元测试生成已成为大型语言模型(LLM)的重要应用。然而,现有评估基准主要针对函数或类级别代码(单文件),而非更具挑战性的多文件级代码库。为解决此限制,我们提出了MultiFileTest,一个涵盖Python、Java和JavaScript的多文件级基准。该基准包含每种语言20个中等规模且高质量的项目。我们评估了11个前沿LLM,结果显示大多数LLM在MultiFileTest上表现一般,突显了该基准的难度。我们还进行了深入的错误分析,发现即使先进LLM如Gemini-3.0-Pro也存在基本但关键的错误,包括执行性和级联错误。受此启发,我们进一步在手动和自修复错误场景下评估所有前沿LLM,以评估其配备错误修复机制的潜力。我们的代码和数据集可在https://github.com/YiboWANG214/ProjectTest获取。
英文摘要:
Unit test generation has become a promising and important Large Language Model (LLM) use case. However, existing evaluation benchmarks for LLM unit test generation focus on function- or class-level code (single-file) rather than more practical and challenging multi-file-level codebases. To address such a limitation, we propose MultiFileTest, a multi-file-level benchmark for unit test generation covering Python, Java, and JavaScript. MultiFileTest features 20 moderate-sized and high-quality projects per language. We evaluate eleven frontier LLMs on MultiFileTest, and the results show that most frontier LLMs tested exhibit moderate performance on MultiFileTest, highlighting the difficulty of MultiFileTest. We also conduct a thorough error analysis, which shows that even advanced LLMs, such as Gemini-3.0-Pro, exhibit basic yet critical errors, including executability and cascade errors. Motivated by this observation, we further evaluate all frontier LLMs under manual error-fixing and self-error-fixing scenarios to assess their potential when equipped with error-fixing mechanisms. Our code and dataset is available at \href{https://github.com/YiboWANG214/ProjectTest}{MultiFileTest}.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。