PCRepair: A Context-Aware Template-Based Approach for Automated Program Repair
Automated Program Repair (APR) is increasingly vital for managing the complexity of modern software systems. However, current APR techniques suffer from inefficiently selecting repair components, resulting in suboptimal patches. To address these limitations, we propose PCRepair, a context-aware template-based methodology for automated software fault repair. This approach integrates predefined repair templates with context-aware analysis to improve repair accuracy and efficiency. PCRepair first localizes suspicious statements via the Ochiai technique, then matches their contextual patterns with relevant templates. This strategy narrows the search space and generates semantically relevant candidate patches. We prioritize these patches using a weighted fusion similarity metric and sequentially validate them against existing test cases. Evaluations on the Defects4J benchmark show that PCRepair successfully repaired 38 defects, demonstrating competitive performance compared to existing methods, particularly in terms of repair efficiency, with a 9.62% success rate and an average repair time of fewer than 30 min per defect.
Authors
- Yonghe Chu (ORCID: https://orcid.org/0000-0002-2140-5694)
- Heling Cao (ORCID: https://orcid.org/0000-0002-0610-9061)
- Miaolei Deng (ORCID: https://orcid.org/0000-0003-4366-4643)
- Weihao Zhang (ORCID: https://orcid.org/0000-0002-9301-8538)
- Zhenghao He (ORCID: https://orcid.org/0000-0002-9576-3275)
- Yun Wang (ORCID: https://orcid.org/0000-0003-4907-4150)
Institutions
- Henan University of Technology (CN)
- Henan University of Engineering (CN)
Publication Details
- Journal
- International Journal of Software Engineering and Knowledge Engineering
- Published
- 2025-10-08
- DOI
- https://doi.org/10.1142/s0218194025500731
- Primary Topic
- Molecular Biology Techniques and Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00