一句话:提出SemRef,结合LLM语义理解与依赖分析,自动精化已有架构恢复工具的输出,提升准确性与可理解性。
大型软件系统的架构理解对维护和管理至关重要,但设计架构与实现架构常存在差异。从代码中恢复实现架构耗时且易错,现有自动架构恢复技术精度有限,仍依赖人工精化。SemRef将LLM的语义理解能力与依赖分析相结合,自动精化现有架构恢复工具的输出。评估使用9个已有公开基准架构的项目和10个先进架构恢复工具,采用5种常用指标。结果显示,SemRef在不同指标上取得17.72%至43.35%的归一化提升,MoJoFM和a2aadj分别相对提升118.57%和100.41%。其性能在从数千行到数万亿行代码的项目上保持稳定,成本随项目规模线性增长,并在不同LLM上展现泛化性。此外,SemRef还能提供结构化模块层级和层次化模块摘要,增强恢复架构的可理解性。
Understanding the architecture is crucial for effectively maintaining and managing large software systems. However, discrepancies often exist between the designed and implemented architectures, which can pose significant risks. To identify these discrepancies, architects need to extract the architecture from the system implementation, which is both time-consuming and error-prone. To simplify this procedure, many automatic architecture recovery techniques have been developed. Yet, their accuracy is often limited. Architects must still invest significant effort in refining recovery results to ensure they accurately reflect the implemented architecture. To reduce such manual effort, we introduce SemRef, a framework that combines LLMs with dependency analysis to automatically refine architectures recovered by existing architecture recovery tools. By leveraging the LLM’s semantic understanding capabilities and integrating structural dependencies, SemRef enhances both the accuracy and the comprehension of recovered architectures. To evaluate SemRef, we tested on 9 projects with published ground-truth architectures and 10 state-of-the-art architecture recovery tools. 5 commonly used metrics are adopted to evaluate the effectiveness of SemRef. The results show that SemRef improves accuracy across various metrics, with normalized gains ranges from 17.72% to 43.35%. Specifically, for MoJoFM and a2aadj metrics, SemRef achieves relative improvements of 118.57% and 100.41%, respectively. Moreover, SemRef is highly scalable. It maintains stable performance across projects ranging from thousands to trillions of lines of code with the cost scale linearly with project size. Further, we test SemRef on various LLMs to demonstrate its generalizability across different models. Beyond improving accuracy, the integration of LLMs enables SemRef to provide a structured module hierarchy and hierarchical module summaries, which further enhance the comprehensibility of recovered architectures.
@inproceedings{abs-2607-23774,
title = {Semantic-Enhanced Automatic Refinement of Architecture Recovery Results Using LLMs},
author = {Yiran Zhang and Chengwei Liu and Yuqiang Sun and Zhengzi Xu and Weisong Sun and Wenke Li and Wuxia Jin and Yang Liu},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3744916.3773114}
}