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

📄 arXiv: 2607.12605v1 📥 PDF

作者: Zhili Huang, Ling Xu, Hongyu Zhang

分类: cs.SE, cs.AI

发布日期: 2026-07-14

备注: 12 pages, 5 figures, 10 tables


💡 一句话要点

提出CT-Repair框架以解决自动程序修复中的上下文问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 自动程序修复 代码属性图 时间执行图 多视角分析 有限状态机 修复策略生成 软件维护 机器学习

📋 核心要点

  1. 现有的自动程序修复方法在处理执行轨迹时面临上下文信息冗余和不一致的问题。
  2. CT-Repair框架通过构建可查询的代码属性图和时间执行图,整合静态和动态证据,提升修复策略的有效性。
  3. 在854个Java bug的实验中,CT-Repair成功修复了489个bug,显著优于现有方法的表现。

📝 摘要(中文)

大型语言模型(LLMs)在自动程序修复(APR)方面取得了进展,但仍存在两个主要限制。首先,原始执行轨迹通常过于庞大和重复,无法有效作为模型上下文。其次,重复的补丁采样可能产生不同的实现,但未能提供明确的根本原因假设或修复策略。为此,本文提出CT-Repair,一个通过可查询的代码属性图(CPG)和时间执行图(TEG)表示静态和动态证据的代理APR框架。CT-Repair采用三阶段过滤管道构建紧凑的TEG,并通过有限状态机引导的代理从静态、动态和混合视角分析每个bug,独立生成基于证据的修复策略。最后,通过验证反馈来优化最有前景的策略。

🔬 方法详解

问题定义:本文旨在解决现有自动程序修复方法在处理执行轨迹时的冗余和不一致问题,导致修复策略的有效性不足。

核心思路:CT-Repair框架通过构建可查询的代码属性图(CPG)和时间执行图(TEG),整合静态和动态证据,从而提升修复策略的准确性和有效性。

技术框架:CT-Repair的整体架构包括三阶段过滤管道、有限状态机引导的代理分析模块,以及基于策略的生成程序。过滤管道用于构建紧凑的TEG,代理模块从不同视角分析bug,生成候选修复策略。

关键创新:CT-Repair的主要创新在于引入了多视角的证据分析和结构化的运行时证据处理,显著提高了修复的有效性,而不是单纯依赖于更大的补丁生成预算。

关键设计:在设计中,CT-Repair采用了三阶段的过滤策略,执行过滤平均缩小候选方法范围94.85%,行为过滤进一步减少保留的运行时记录55.97%。

🖼️ 关键图片

img_0
img_1
img_2

📊 实验亮点

CT-Repair在854个Java bug的测试中成功修复了489个bug,表现优于ReinFix和RepairAgent,分别多修复了19个和30个bug。此外,三种证据视角的联合使用比最强的单一视角多修复了99个bug,显示出其多视角推理的有效性。

🎯 应用场景

CT-Repair框架在软件开发和维护领域具有广泛的应用潜力,尤其是在自动化测试和缺陷修复方面。其有效的修复策略生成和优化过程能够显著提高软件质量,降低维护成本,未来可扩展到其他编程语言和复杂系统的自动修复任务中。

📄 摘要(原文)

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.