用大模型自动构建可运行的代码环境,让代码仓库真正可用。
Repo2Run: Automated Building Executable Environment for Code Repository at Scale
- 用大模型迭代生成Dockerfile并测试,自动搭建可运行环境。
- 在420个仓库上成功率86.0%,优于SWE-agent的77.0%。
- 适合需要批量运行代码的工程自动化与测试研究者。
扩大可执行代码数据对提升语言模型的软件工程能力至关重要。然而,构建大量可运行代码仓库的过程复杂、耗时且依赖专家知识,严重限制了基于运行测试的现有工作的可扩展性。主要瓶颈在于为不同仓库自动构建测试环境,这一关键任务尚未得到充分研究。为此,我们提出Repo2Run,首个基于大模型的智能体,旨在大规模自动化构建任意代码仓库的可执行测试环境。具体而言,给定一个代码仓库,Repo2Run通过迭代生成Dockerfile、运行单元测试并根据反馈调整,直至整个流程成功执行。最终生成的Dockerfile可用于创建可运行代码和测试的Docker容器环境。我们构建了一个包含420个带单元测试的Python仓库的基准测试集。结果表明,Repo2Run达到86.0%的成功率,优于SWE-agent的77.0%。相关资源已开源:https://github.com/bytedance/Repo2Run。
原文摘要 · Abstract (English)
Scaling up executable code data is significant for improving language models' software engineering capability. The intricate nature of the process makes it labor-intensive, time-consuming and expert-knowledge-dependent to build a large number of executable code repositories, limiting the scalability of existing work based on running tests. The primary bottleneck lies in the automated building of test environments for different repositories, which is an essential yet underexplored task. To mitigate the gap, we introduce Repo2Run, the first LLM-based agent aiming at automating the building of executable test environments for any repositories at scale. Specifically, given a code repository, Repo2Run iteratively builds the Docker image, runs unit tests based on the feedback of the building, and synthesizes the Dockerfile until the entire pipeline is executed successfully. The resulting Dockerfile can then be used to create Docker container environments for running code and tests. We created a benchmark containing 420 Python repositories with unit tests for evaluation. The results illustrate that Repo2Run achieves an 86.0% success rate, outperforming SWE-agent by 77.0%. The resources of Repo2Run are available at https://github.com/bytedance/Repo2Run.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。