ASNER:基于自适应语义邻域与证据驱动优化的软件架构恢复
ASNER: Software Architecture Recovery with Adaptive Semantic Neighborhoods and Evidence-Grounded Refinement
AI总结:
本文提出ASNER方法,通过自适应语义邻域构建与ROA智能体的证据驱动边界优化恢复软件架构,在12个多语言开源项目基准上较GAER-GAT显著提升指标,还能增强下游代码定位任务性能。
摘要:
自动化软件架构恢复为软件工程及仓库级大语言模型(LLM)智能体提供架构上下文。现有方法结合结构与语义信号,但功能相关性未必意味着共享架构职责;固定阈值或Top-K邻域也会忽略仓库规模与局部相似度分布,引入的误差会在聚类中传播;无约束的LLM优化还可能在证据不足时修改正确分配。本文提出ASNER(软件架构恢复用自适应语义邻域与证据驱动优化),基于感知职责的项目自适应关系建模与证据驱动的边界验证。ASNER通过LLM推导结构化文件职责,构建适配仓库规模与局部相似度分布的语义邻域,用选定语义关系与弱目录线索增强静态依赖图;社区检测恢复组件主干后,感知职责-所有权(ROA)智能体会利用项目级职责与可追溯代码证据检查边界文件的不确定性,仅在有支持时才修改分配。对C、C++、Java、Python共12个开源项目的实验显示,ASNER在通用基准的全部5项指标上取得最佳宏平均,较GAER-GAT的调整兰德指数(ARI)与组件到组件@66(c2c@66)分别提升19.5%与32.9%;下游评估表明,ASNER引导的LocAgent改进了文件、模块与函数级代码定位,证明其架构上下文对仓库级软件工程任务的价值。
英文摘要:
Automated software architecture recovery provides architectural context for software engineering and repository-level LLM agents. Existing methods combine structural and semantic signals, but functional relatedness does not necessarily imply shared architectural responsibility. Fixed thresholds or Top-K neighborhoods also ignore repository scale and local similarity distributions, introducing errors that propagate through clustering. Unconstrained LLM refinement may further alter correct assignments without sufficient evidence. We propose ASNER (Adaptive Semantic Neighborhoods and Evidence-Grounded Refinement for Software Architecture Recovery), based on responsibility-aware, project-adaptive relation modeling and evidence-grounded boundary verification. ASNER derives structured file responsibilities with an LLM, constructs semantic neighborhoods that adapt to repository scale and local similarity distributions, and augments a static dependency graph with selected semantic relations and weak directory cues. Community detection recovers the component backbone. A Responsibility-Ownership-Aware (ROA) Agent then examines uncertain boundary files using project-level responsibilities and traceable code evidence, changing assignments only when supported. Experiments on 12 open-source projects spanning C, C++, Java, and Python show that ASNER achieves the best macro-average on all five metrics on the common benchmark, improving ARI and c2c@66 over GAER-GAT by 19.5% and 32.9%, respectively. A downstream evaluation shows that ASNER-guided LocAgent improves file-, module-, and function-level code localization, demonstrating the value of its architectural context for repository-level software engineering tasks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。