Fuzzy-AutoRepair: Expert-Validated Repair-Pattern-Conditioned Re-Ranking and Search-Cost Analysis for C/C++ Program Repair

Document Type : Research Manuscript

Authors

1 Department of Computer Engineering and Information Technology, Qa.C., Islamic Azad University, Qazvin, Iran

2 Department of Computer Engineering, Iran University of Science and Technology, Tehran, Iran

3 Department of Computer Science, Faculty of Mathematical Sciences, University of Tabriz, Tabriz, Iran

Abstract
Automated program repair (APR) for C/C++ programs is hindered by uncertain fault-localisation signals, large candidate spaces, costly test-based validation, and limited interpretability in learned or prompt-based repair decisions. This paper introduces Fuzzy-AutoRepair, an uncertainty-aware fuzzy learning-to-rank framework that prioritises explicit repair-pattern families prior to candidate generation. Unlike open-ended code generation, the proposed method represents each suspicious code region using 40 Boolean fault-local and contextual features and constrains candidate generation to 13 auditable AST-level repair-pattern families. The central novelty is a fuzzy inference layer that converts overlapping syntactic, data-dependence, control-context, API-call, enumeration, loop-header, and structural-risk evidence into linguistic repair suitability scores. These scores are fused with pairwise learning-to-rank relevance so that the exploration order is determined jointly by data-driven prediction and expert-readable fuzzy rationale, while type, scope, syntactic, and structural preconditions remain hard validity constraints. On 2,244 held-out pattern-selection samples and a 69-defect C/C++ benchmark, defect-level execution logs show that the balanced fuzzy-LTR configuration gives the strongest observed ranking and search-cost behaviour among the evaluated ordering variants. Compared with the LTR-only AutoRepair baseline, it improves Recall@1 from 0.45 to 0.50 (+11.1%), Recall@3 from 0.74 to 0.80 (+8.1%), and NDCG@5 from 0.78 to 0.84 (+7.7%). It also reduces generated candidates from 914 to 620 per defect (-32.2%), compilation attempts from 337 to 238 (-29.4%), and mean runtime from 49.38 to 41.70 minutes (-15.6%). The logs additionally show secondary observed differences in plausible repairs (33/69 versus 36/69) and correct-first repairs (14/69 versus 17/69).

Keywords

Subjects


Articles in Press, Accepted Manuscript
Available Online from 30 August 2026