arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2506.09003cs.CL
收藏

SWE-Flow:以测试驱动的方式合成软件工程数据

SWE-Flow: Synthesizing Software Engineering Data in a Test-Driven Manner

Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences, Shenzhen, China(深圳先进技术研究院,中国科学院,中国);Alibaba Group, Beijing, China(阿里巴巴集团,中国);Zhejiang University, Hangzhou, China(浙江大学,中国);University of Science and Technology of China, Hefei, China(中国科学技术大学,中国)

Lei Zhang, Jiaxi Yang, Min Yang, Jian Yang, Mouxiang Chen, Jiajun Zhang, Zeyu Cui, Binyuan Hui, Junyang Lin

AI总结:

该研究提出基于测试驱动开发的软件工程数据合成框架SWE-Flow,通过构建运行时依赖图生成可验证的TDD任务,构建了SWE-Flow-Eval基准,实验证明该数据集可有效提升开源模型的TDD编码性能。

摘要:

我们提出了**SWE-Flow**,这是一种基于测试驱动开发(Test-Driven Development, TDD)的新型数据合成框架。与现有依赖人工提交问题的软件工程数据不同,**SWE-Flow**可直接从单元测试中自动推断增量开发步骤,而单元测试本身就封装了高层需求。**SWE-Flow**的核心是构建运行时依赖图(Runtime Dependency Graph, RDG),该图可精确捕捉函数交互,从而生成结构化的逐步“开发进度表”。在每一步中,**SWE-Flow**都会生成部分代码库、对应的单元测试以及必要的代码修改,最终形成完全可验证的TDD任务。通过这种方法,我们从真实世界的GitHub项目中生成了16061个训练实例和2020个测试实例,构建了**SWE-Flow-Eval**基准。我们的实验表明,在该数据集上微调开源模型可显著提升其在基于TDD的编码任务中的性能。为推动后续研究,我们在GitHub上公开了所有代码、数据集、模型和Docker镜像。

英文摘要:

We introduce **SWE-Flow**, a novel data synthesis framework grounded in Test-Driven Development (TDD). Unlike existing software engineering data that rely on human-submitted issues, **SWE-Flow** automatically infers incremental development steps directly from unit tests, which inherently encapsulate high-level requirements. The core of **SWE-Flow** is the construction of a Runtime Dependency Graph (RDG), which precisely captures function interactions, enabling the generation of a structured, step-by-step *development schedule*. At each step, **SWE-Flow** produces a partial codebase, the corresponding unit tests, and the necessary code modifications, resulting in fully verifiable TDD tasks. With this approach, we generated 16,061 training instances and 2,020 test instances from real-world GitHub projects, creating the **SWE-Flow-Eval** benchmark. Our experiments show that fine-tuning open model on this dataset significantly improves performance in TDD-based coding. To facilitate further research, we release all code, datasets, models, and Docker images at [Github](https://github.com/Hambaobao/SWE-Flow).

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

↑