arXiv:2607.12605cs.SEcs.AI2026-07被引 1

用多视角图结构提升代码修复效率,显著减少无效尝试。

Multi-Perspective Agentic Program Repair via Code Property Graphs and Temporal Execution Graphs

论文配图:Multi-Perspective Agentic Program Repair via Code Property Graphs and Temporal Execution Graphs
图 1 · 摘自论文原文
  • 构建代码属性图与动态执行图,分三阶段压缩运行时证据
  • 三个独立代理从静态、动态、混合视角提出修复策略,成功修复489个缺陷
  • 多视角联合修复效果比单一视角高99个漏洞,适合需要高可靠性的修复场景

大语言模型虽提升了自动化程序修复能力,但仍存在两大局限:原始执行轨迹过大且重复,难以作为有效模型上下文;重复采样生成的补丁缺乏根本原因假设差异。本文提出CT-Repair框架,将静态与动态证据表示为可查询的代码属性图(CPG)和时序执行图(TEG)。通过三阶段过滤管道构建紧凑的TEG。三个基于有限状态机的代理分别从静态、动态和混合视角分析漏洞,独立生成有证据支持的修复策略。采用策略引导生成流程将策略转化为候选补丁,并利用验证反馈优化最优策略。在Defects4J v3.0的854个Java漏洞上评估,混合模型配置下修复489个漏洞;在控制版GPT-5.4-mini配置下修复388个,分别比ReinFix和RepairAgent多修复19和30个。三种视角联合修复比最强单视角多修复99个漏洞。过滤管道显著压缩运行时证据:执行过滤平均缩小方法范围94.85%,行为过滤进一步减少55.97%的保留记录。结果表明,结构化运行证据与多视角推理可提升修复效果,无需依赖更大补丁生成预算。

原文摘要 · Abstract (English)

Large language models (LLMs) have improved automated program repair (APR), but two limitations remain. First, raw execution traces are often too large and repetitive to serve as effective model context. Second, repeated patch sampling may produce different implementations without yielding distinct root-cause hypotheses or repair strategies. We present CT-Repair, an agentic APR framework representing static and dynamic evidence as queryable Code Property Graph (CPG) and Temporal Execution Graph (TEG). CT-Repair applies a three-stage filtering pipeline to construct compact TEGs. Three finite-state-machine-guided agents analyze each bug from static, dynamic, and hybrid perspectives and independently produce evidence-grounded repair strategies. A strategy-guided generation procedure instantiates these strategies as candidate patches and uses validation feedback to refine the most promising strategy. We evaluate CT-Repair on 854 Java bugs from Defects4J v3.0. In the mixed-model configuration, CT-Repair correctly repairs 489 bugs. Under a controlled GPT-5.4-mini configuration, it repairs 388 bugs, 19 and 30 more than ReinFix and RepairAgent, respectively. The union of the three evidence perspectives repairs 99 more bugs than the strongest individual perspective. The filtering pipeline also compacts runtime evidence, with execution filtering narrowing the candidate method scope by 94.85% on average and behavior filtering further reducing retained runtime records by 55.97%. These results show that structured runtime evidence and multi-perspective reasoning can improve repair effectiveness without relying solely on a larger patch-generation budget.

程序修复多视角推理代码图LLM应用

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。