---
title: "CT-Repair：基于代码属性图与时序执行图的多视角智能体程序修复"
source: "arXiv AI/CL/LG（论文）"
source_tier: "t2"
url: "https://arxiv.org/abs/2607.12605v1"
permalink: "https://feed.astralor.com/items/itm_92bf1f427a77b7cedc2588cc"
published: "2026-07-14T10:33:29.000Z"
score: 81
channel: "ai"
tags: ["CT-Repair","GPT-5.4-mini","代码属性图","多智能体","时序执行图","自动程序修复"]
---

# CT-Repair：基于代码属性图与时序执行图的多视角智能体程序修复

## AI 点评

> CT-Repair给我最大的启发是“不要只堆补丁数量，而是让模型看见程序的灵魂”——通过CPG和TEG让LLM理解代码的静态骨架与动态血统。对于从事AI for SE的研究者和工程师来说，这篇论文不仅提供了可复现的高性能基线，还展示了如何将程序分析工具与LLM巧妙结合，尤其适合对上下文窗口敏感的场景。强烈建议结合他们开源的工具链复现实验。

## 速览

大型语言模型（LLM）提升了自动化程序修复（APR）能力，但面临原始执行轨迹庞大冗余、补丁采样缺乏根因多样性等限制。本文提出CT-Repair，一种智能体APR框架，将静态与动态证据表示为可查询的代码属性图（CPG）和时序执行图（TEG）。通过三阶段过滤流水线构建紧凑TEG，三个有限状态机引导的智能体分别从静态、动态和混合视角分析每个错误并生成证据驱动的修复策略，策略引导的生成过程将策略实例化为候选补丁并利用验证反馈优化最佳策略。在Defects4J v3.0的854个Java错误上评估，混合模型配置正确修复489个，受控GPT-5.4-mini配置修复388个，比ReinFix和RepairAgent分别多19和30个。三个视角联合修复比最强单视角多99个错误。过滤流水线将运行时证据压缩，执行过滤平均缩小候选方法范围94.85%，行为过滤进一步减少保留记录55.97%。结果表明结构化运行时证据与多视角推理可在不依赖更大补丁生成预算下提高修复效果。

## 关键点

- CT-Repair 通过代码属性图（CPG）和时序执行图（TEG）统一表示静态与动态程序证据，支持多视角推理。
- 三阶段过滤流水线（执行过滤、行为过滤、TEG构建）将运行时证据压缩至原始规模的5%以下，大幅提高上下文效率。
- 三个有限状态机引导的智能体分别从静态、动态和混合视角生成修复策略，策略引导的补丁生成与验证反馈迭代优化。
- 在Defects4J v3.0上，CT-Repair以GPT-5.4-mini为基座修复388个错误，超过ReinFix和RepairAgent，且多视角联合修复比单视角多99个错误。

## 全文

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.

---

引用前请核对原文;本文由星际流动整理:https://feed.astralor.com/items/itm_92bf1f427a77b7cedc2588cc
