一句话:提出多智能体框架LOCALIZEAGENT,利用LLM将程序分析结果转为自然语言摘要并定位代码设计问题。
软件设计质量对系统长期可维护性至关重要,但代码库增长会引入模块化差、复杂度过高等设计问题。开发者常依赖程序分析工具识别问题,然而大型代码库超出LLM上下文窗口,且程序分析输出(如程序依赖图、交互式可视化)为非文本模态,难以直接作为LLM的自然语言输入。为此,本文提出LOCALIZEAGENT,一个多智能体框架,集成四类专门智能体:分析代码以识别潜在设计问题、将程序分析输出转化为抽象感知且LLM友好的自然语言摘要、生成面向特定重构类型的上下文提示、利用LLM定位并排序相关设计问题。在多个真实代码库上的评估表明,该方法显著优于基线,在信息隐藏、复杂度和模块化问题定位的精确匹配准确率上分别取得138%、166%和206%的相对提升。
Maintaining software design quality is crucial for the long-term maintainability and evolution of systems. However, design issues such as poor modularity and excessive complexity often emerge as codebases grow. Developers rely on external tools, such as program analysis techniques, to identify such issues. This work leverages Large Language Models (LLMs) to develop an automated approach for analyzing and localizing design issues. Large language models have demonstrated significant performance on coding tasks, but directly leveraging them for design issue localization is challenging. Large codebases exceed typical LLM context windows, and program analysis tool outputs in non-textual modalities (e.g., graphs or interactive visualizations) are incompatible with LLMs' natural language inputs. To address these challenges, we propose LOCALIZEAGENT, a novel multi-agent framework for effective design issue localization. LOCALIZEAGENT integrates the specialized agents that (1) analyze code to identify potential code design issues, (2) transform program analysis outputs into abstraction-aware LLM-friendly natural language summaries, (3) generate context-aware prompts tailored to specific refactoring types, and (4) leverage LLMs to locate and rank the localized issues based on their relevance. Our evaluation using diverse real-world codebases demonstrates significant improvements over the baseline approaches, with LOCALIZEAGENT achieving$138 \%, 166 \%$, and 206 % relative improvements in exact-match accuracy for localizing information hiding, complexity, and modularity issues, respectively.
DOI 原文 ·
@inproceedings{paperbot8780,
title = {An LLM-Based Agent-Oriented Approach for Automated Code Design Issue Localization},
author = {Fraol Batole and David OBrien and Tien N. Nguyen and Robert Dyer and Hridesh Rajan},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00100}
}