PatchZero: Zero-Shot Automatic Patch Correctness Assessment

03/01/2023
by   Xin Zhou, et al.
0

Automated Program Repair (APR) techniques have shown more and more promising results in fixing real-world bugs. Despite the effectiveness, APR techniques still face an overfitting problem: a generated patch can be incorrect although it passes all tests. It is time-consuming to manually evaluate the correctness of generated patches that can pass all tests. To address this problem, many approaches have been proposed to automatically assess the correctness of patches generated by APR techniques. However, existing approaches require a large set of manually labeled patches as the training data. To mitigate the issue, in this study, we propose PatchZero, the patch correctness assessment by adopting large pre-trained models. Specifically, for patches generated by a new or unseen APR tool, PatchZero does not need labeled patches of this new or unseen APR tool for training (i.e., zero-shot) but directly queries the large pre-trained model to get predictions on the correctness labels without training. In this way, PatchZero can reduce the manual labeling effort when building a model to automatically assess the correctness of generated patches of new APR tools. To provide knowledge regarding the automatic patch correctness assessment (APCA) task to the large pre-trained models, we also design an instance-wise demonstration formation strategy by using contrastive learning. Specifically, PatchZero selects semantically similar patches to help the large pre-trained model to give more accurate predictions on the unlabeled patches. Our experimental results showed that PatchZero can achieve an accuracy of 82.7 new or unseen APR tool is available. In addition, our proposed technique outperformed the prior state-of-the-art by a large margin.

READ FULL TEXT
research
01/29/2023

Boosting Automated Patch Correctness Prediction via Pre-trained Language Model

Automated program repair (APR) aims to fix software bugs automatically w...
research
01/03/2023

Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning

In this paper, we propose a novel technique, namely INVALIDATOR, to auto...
research
05/15/2018

On Reliability of Patch Correctness Assessment

Current state-of-the-art automatic software repair (ASR) techniques rely...
research
07/14/2022

Attention: Not Just Another Dataset for Patch-Correctness Checking

Automated Program Repair (APR) techniques have drawn wide attention from...
research
08/07/2020

Evaluating Representation Learning of Code Changes for Predicting Patch Correctness in Program Repair

A large body of the literature of automated program repair develops appr...
research
08/08/2022

Is this Change the Answer to that Problem? Correlating Descriptions of Bug and Code Changes for Evaluating Patch Correctness

In this work, we propose a novel perspective to the problem of patch cor...
research
09/15/2022

On the acceptance by code reviewers of candidate security patches suggested by Automated Program Repair tools

Background: Testing and validation of the semantic correctness of patche...

Please sign up or login with your details

Forgot password? Click here to reset