SWE-Flow: Sintesi di Dati di Ingegneria del Software in Modalità Test-Driven
SWE-Flow: Synthesizing Software Engineering Data in a Test-Driven Manner
June 10, 2025
Autori: Lei Zhang, Jiaxi Yang, Min Yang, Jian Yang, Mouxiang Chen, Jiajun Zhang, Zeyu Cui, Binyuan Hui, Junyang Lin
cs.AI
Abstract
Presentiamo **SWE-Flow**, un innovativo framework di sintesi dati basato sullo sviluppo guidato dai test (Test-Driven Development, TDD). A differenza dei dati di ingegneria del software esistenti che si affidano a problemi segnalati da esseri umani, **SWE-Flow** deduce automaticamente i passaggi incrementali di sviluppo direttamente dai test unitari, che racchiudono intrinsecamente requisiti di alto livello. Il cuore di **SWE-Flow** è la costruzione di un Grafo delle Dipendenze a Runtime (Runtime Dependency Graph, RDG), che cattura con precisione le interazioni tra le funzioni, consentendo la generazione di un *piano di sviluppo* strutturato e passo-passo. Ad ogni passaggio, **SWE-Flow** produce una base di codice parziale, i corrispondenti test unitari e le necessarie modifiche al codice, risultando in task TDD completamente verificabili. Con questo approccio, abbiamo generato 16.061 istanze di training e 2.020 istanze di test da progetti reali di GitHub, creando il benchmark **SWE-Flow-Eval**. I nostri esperimenti dimostrano che il fine-tuning di modelli open su questo dataset migliora significativamente le prestazioni nella codifica basata su TDD. Per facilitare ulteriori ricerche, rilasciamo tutto il codice, i dataset, i modelli e le immagini Docker su [Github](https://github.com/Hambaobao/SWE-Flow).
English
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).