paperbot · PL 论文追踪

全部论文 待读 收藏

P2 UniTSyn: A Large-Scale Dataset Capable of Enhancing the Prowess of Large Language Models for Program Testing

UniTSyn:一个可增强大型语言模型程序测试能力的大规模数据集
ISSTA Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis2024匹配度 3/10 · 该论文聚焦于用大规模焦点-测试配对数据集增强 LLM 的单元测试生成能力,属于 ML+SE 的交叉,但研究目标本身是提升 LLM 能力,而非将静态分析应用于 Agentic/ML 系统,也不是用 LLM 改进静态分析或形式化验证,与浮点程序分析、贝叶斯程序分析亦无关联。仅因涉及程序语言与测试/调试主题,与画像有微弱的概念邻近。引用 12 inbox
Yifeng He, Jiabo Huang, Yuyang Rong, Yiwen Guo, Ethan Wang, Hao Chen
crossref: 2026-09-12

AI 速览

一句话:提出大规模焦点-测试配对数据集 UniTSyn,显著提升 LLM 的单元测试生成准确率与代码覆盖率。

现有代码大语言模型在生成准确、完整的测试方面表现不佳,因为其训练语料未区分测试代码与其他代码,且将测试与被测函数关联对推断预期行为和验证路径至关重要。本文提出大规模数据集 UniTSyn,利用 Language Server Protocol 收集焦点函数—测试对,无需逐项目执行环境或逐语言启发式规则,从而可扩展地构建数据。UniTSyn 覆盖五种主流编程语言,包含 270 万对焦点-测试。实验基于 UniTSyn 构建自回归 LLM,并在多种语言上评估,结果表明该数据集显著提升模型对单元测试表示的学习与理解,改善测试生成准确率和代码覆盖率。

问题
现有代码 LLM 难以生成准确、完整的单元测试,主因是训练数据未区分测试代码且缺少测试与被测函数的关联。
方法
本文利用 Language Server Protocol 构建大规模焦点-测试配对数据集 UniTSyn,覆盖五种主流语言、270 万对样本,无需逐项目执行配置或逐语言启发式。
评估
通过基于 UniTSyn 训练自回归 LLM,在多种语言上评估单元测试生成,结果显示生成准确率和代码覆盖率均有提升。
原文摘要(Abstract)

The remarkable capability of large language models (LLMs) in generating high-quality code has drawn increasing attention in the software testing community. However, existing code LLMs often demonstrate unsatisfactory capabilities in generating accurate, complete tests since they were trained on code snippets collected without differentiating between code for testing and for other purposes. In this paper, we present a large-scale dataset, UniTSyn, which can enhance LLMs for Unit Test Synthesis. Associating tests with the tested functions is crucial for LLMs to infer the expected behavior and the logic paths to be verified. By leveraging Language Server Protocol, UniTSyn achieves the challenging goal of collecting focal-test pairs without per-project execution setups or per-language heuristics, which tend to be fragile and difficult to scale. Containing 2.7 million focal-test pairs across five mainstream programming languages, it can enhance the test generation ability of LLMs. Our experiments demonstrate that, by building an autoregressive LLM based on UniTSyn, we can achieve significant benefits in learning and understanding unit test representations, resulting in improved generation accuracy and code coverage across all the evaluated programming languages.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8498,
  title = {UniTSyn: A Large-Scale Dataset Capable of Enhancing the Prowess of Large Language Models for Program Testing},
  author = {Yifeng He and Jiabo Huang and Yuyang Rong and Yiwen Guo and Ethan Wang and Hao Chen},
  booktitle = {ISSTA},
  year = {2024},
  doi = {10.1145/3650212.3680342}
}