用AI代理模拟开发者思维,精准定位代码缺陷。
Improved Bug Localization with AI Agents Leveraging Hypothesis and Dynamic Cognition

- 多智能体协同推理,基于调用图分析根因
- 在591个真实缺陷上提升定位准确率23%-38%
- 适合需要高效调试的软件开发团队
软件缺陷每年给科技公司(如AT&T)带来数十亿美元损失,开发者约一半时间用于修复。传统方法孤立分析代码组件可疑度,忽视其与其他组件的关联。尽管大语言模型和智能体技术在代码理解上展现潜力,但缺乏因果推理能力,且难以有效管理上下文。本文提出新型智能体技术CogniGent,通过具备因果推理、调用图驱动的根因分析与上下文工程能力的多个智能体,模拟开发者动态认知调试实践,进行假设验证以支持缺陷定位。我们在包含591个缺陷报告的精选数据集上评估,采用三种主流指标对比六种基准方法。实验表明,该技术在文档与方法层面均显著优于现有方法,平均准确率(MAP)提升23.33%-38.57%,中位数排名倒数(MRR)提升25.14%-53.74%。统计检验确认其优越性。CogniGent通过解决推理、依赖与上下文限制,推动缺陷定位技术发展,实现人类认知与智能自动化融合。
原文摘要 · Abstract (English)
Software bugs cost technology providers (e.g., AT&T) billions annually and cause developers to spend roughly 50% of their time on bug resolution. Traditional methods for bug localization often analyze the suspiciousness of code components (e.g., methods, documents) in isolation, overlooking their connections with other components in the codebase. Recent advances in Large Language Models (LLMs) and agentic AI techniques have shown strong potential for code understanding, but still lack causal reasoning during code exploration and struggle to manage growing context effectively, limiting their capability. In this paper, we present a novel agentic technique for bug localization -- CogniGent -- that overcomes the limitations above by leveraging multiple AI agents capable of causal reasoning, call-graph-based root cause analysis and context engineering. It emulates developers-inspired debugging practices (a.k.a., dynamic cognitive debugging) and conducts hypothesis testing to support bug localization. We evaluate CogniGent on a curated dataset of 591 bug reports using three widely adopted performance metrics and compare it against six established baselines from the literature. Experimental results show that our technique consistently outperformed existing traditional and LLM-based techniques, achieving MAP improvements of 23.33-38.57% at the document and method levels. Similar gains were observed in MRR, with increases of 25.14-53.74% at both granularity levels. Statistical significance tests also confirm the superiority of our technique. By addressing the reasoning, dependency, and context limitations, CogniGent advances the state of bug localization, bridging human-like cognition with agentic automation for improved performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。