GAMMA: Revisiting Template-based Automated Program Repair via Mask Prediction
Quanjun Zhang, Chunrong Fang, Tongke Zhang, Bowen Yu, Weisong Sun,, Zhenyu Chen

TL;DR
GAMMA leverages large pre-trained language models to improve template-based automated program repair by predicting donor code tokens directly from context, significantly enhancing repair accuracy and generalizability.
Contribution
This paper introduces GAMMA, a novel approach that transforms fix templates into mask patterns and uses pre-trained language models for donor code prediction, advancing template-based APR.
Findings
GAMMA repairs 82 bugs on Defects4J-v1.2, outperforming previous methods.
GAMMA demonstrates strong generalizability across datasets.
Using different pre-trained models like CodeBERT and ChatGPT further improves repair performance.
Abstract
Automated program repair (APR) aims to fix software bugs without human intervention and template-based APR has been widely investigated with promising results. However, it is challenging for template-based APR to select the appropriate donor code, which is an important repair ingredient for generating candidate patches. Inappropriate donor code may cause plausible but incorrect patch generation even with correct fix patterns, limiting the repair performance. In this paper, we aim to revisit template-based APR, and propose GAMMA, to directly leverage large pre-trained language models for donor code generation. Our main insight is that instead of retrieving donor code in the local buggy file, we can directly predict the correct code tokens based on the context code snippets and repair patterns by a cloze task. Specifically, (1) GAMMA revises a variety of fix templates from…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Software System Performance and Reliability · Software Engineering Research
