Skip to main navigation Skip to search Skip to main content

StructFix: a structure-aware reasoning framework for automated program repair with code property graphs

  • Mengtian Cui
  • , Yangfan Liu
  • , Zhibo Lu
  • , Yancui Hu
  • , Peican Zhu
  • Southwest University for Nationalities

Research output: Contribution to journalArticlepeer-review

Abstract

Masked language models are increasingly used as the backbone of patch generation for automated program repair (APR). However, most Pre-trained Language Model (PLM)-based repair systems treat code as token sequences, underutilizing structural cues such as control and data dependencies. Consequently, they can produce test-passing patches that are not fully consistent with the intended behavior. We propose StructFix, a structure-aware APR framework that grounds masked patch generation in Code Property Graphs (CPGs). StructFix constructs method-level CPGs from the unmasked program context, encodes structural dependencies with a graph encoder, and integrates graph evidence into token representations through span-based token–node soft alignment and token-wise gated graph–text fusion. This design enables the model to use structural signals in a context-dependent manner while predicting masked tokens. StructFix correctly repairs 86 Defects4J v1.2 bugs, including 12 not repaired by any compared baseline, and repairs 30 Java and 28 Python defects on QuixBugs, which demonstrates cross-language robustness. Our experimental results show that explicitly coupling structural dependencies with masked generation improves repair effectiveness and enables transfer across datasets.

Original languageEnglish
Article number117
JournalAutomated Software Engineering
Volume33
Issue number4
DOIs
StatePublished - Dec 2026

Keywords

  • Automated program repair
  • Code defects
  • Code property graph
  • Graph–text fusion

Fingerprint

Dive into the research topics of 'StructFix: a structure-aware reasoning framework for automated program repair with code property graphs'. Together they form a unique fingerprint.

Cite this