arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.20068cs.SE
收藏

忒修斯之代码:智能体能否从恢复的设计文档中重建软件?

The Code of Theseus: Can Agents Rebuild Software from Recovered Design Documents?

IDSIA (SUPSI)(瑞士应用信息学与系统研究所(瑞士南方应用科学与艺术大学));DFKI(德国人工智能研究中心)

Cezar Sas, Sandra Mitrović, Fabio Barth, Georg Rehm, Matteo Salani

AI总结:

该研究提出从代码库恢复设计的框架,构建含万余代码库的数据集,通过忒修斯之船实验发现恢复的设计可优化模块结构,为智能体设计提供可扩展数据。

摘要:

大型语言模型(LLM)智能体越来越多地在实现前先设计系统,但用于训练和评估它们的数据集中于实现与测试,而需求和设计制品往往缺失、过时或私有。相比之下,源代码数量充足。先前工作通过向LLM输入源代码或让智能体探索源代码来恢复架构文档,这会使上下文饱和,无法扩展到大量代码库,且仅生成单一制品而非对齐的制品。我们提出一个框架,可从紧凑的代码库表示、静态依赖图及关键上下文文件中恢复对齐的利益相关者意图、需求和架构,并发布包含10764个Java、Python、C/C++和C#代码库的制品作为数据集。一名LLM评判员对三个生成器的制品的评价为:清晰且内部一致,但正确性可靠性较低,抽象层级合适。为测试这些制品是否承载设计,我们提出软件领域的忒修斯之船问题:给定仅接口契约和部分测试,编码智能体仅基于意图,或结合恢复的需求与架构,重建29个Commit0库。这些制品未显著改变保留的通过率(33.7% vs. 35.8%),但使重建的模块结构显著更接近原始结构(模块F1从0.54提升至0.63),无论使用哪个生成器,即便制品简洁也如此。因此,恢复的制品传达了测试未捕获的设计,为在实现前进行设计的智能体提供可扩展的设计级数据来源,而往返测试无需人类参考即可衡量这一点。

英文摘要:

LLM agents increasingly design a system before implementing it, yet the data to train and evaluate them centres on implementation and testing: requirements and design artefacts are often missing, outdated or private. Source code, in contrast, is abundant. Prior work recovers architecture documentation by feeding LLMs the source code or letting agents explore it, which saturates the context, does not scale to many repositories, and yields a single artefact rather than aligned ones. We present a framework that recovers aligned stakeholder intent, requirements and architecture from a compact repository representation, a static dependency graph and key contextual files, and release the artefacts of 10,764 Java, Python, C/C++ and C# repositories as a dataset. An LLM judge rates the artefacts of three generators as clear and internally consistent, but less reliably correct and at the right level of abstraction. To test whether the artefacts carry the design, we pose a software Ship of Theseus: a coding agent rebuilds 29 Commit0 libraries from the intent alone or with the recovered requirements and architecture, given only an interface contract and part of the tests. The artefacts do not significantly change the held-out pass rate (33.7% vs. 35.8%), but bring the rebuilt module structure significantly closer to the original (module F1 from 0.54 to 0.63), with either generator and even with concise artefacts. Recovered artefacts thus convey design that tests do not capture, offering a scalable source of design-level data for agents that design before they implement, and the round trip measures this without human references.

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

↑