用大模型+智能分段,从旧代码自动恢复多视图业务架构。
ArchAgent: Scalable Legacy Software Architecture Recovery with LLMs
- 分阶段分析:先静态分析,再自适应切分代码,最后用大模型合成架构。
- 在典型大型项目上,相比现有方法准确率显著提升,关键模块识别更准。
- 适合需要重构老旧系统的研发团队,尤其关注业务逻辑恢复的场景。
从大规模遗留软件中恢复准确的架构,受限于架构漂移、关系缺失以及大语言模型(LLMs)的上下文限制。我们提出 ArchAgent,一种基于智能体的可扩展框架,结合静态分析、自适应代码分割和大模型驱动的合成技术,从跨仓库代码库中重建多视角、与业务对齐的架构。ArchAgent引入上下文裁剪的可扩展图生成功能,并整合跨仓库数据以识别业务关键模块。对典型大型 GitHub 项目评估显示,其性能显著优于现有基准。消融实验表明,依赖上下文能提高生产级仓库生成架构的准确性;真实案例研究证明其能有效恢复遗留项目中的关键业务逻辑。数据集已公开于 https://github.com/panrusheng/arch-eval-benchmark。
原文摘要 · Abstract (English)
Recovering accurate architecture from large-scale legacy software is hindered by architectural drift, missing relations, and the limited context of Large Language Models (LLMs). We present ArchAgent, a scalable agent-based framework that combines static analysis, adaptive code segmentation, and LLM-powered synthesis to reconstruct multiview, business-aligned architectures from cross-repository codebases. ArchAgent introduces scalable diagram generation with contextual pruning and integrates cross-repository data to identify business-critical modules. Evaluations of typical large-scale GitHub projects show significant improvements over existing benchmarks. An ablation study confirms that dependency context improves the accuracy of generated architectures of production-level repositories, and a real-world case study demonstrates effective recovery of critical business logics from legacy projects. The dataset is available at https://github.com/panrusheng/arch-eval-benchmark.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。