Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning

01/03/2023
by   Thanh Le-Cong, et al.
0

In this paper, we propose a novel technique, namely INVALIDATOR, to automatically assess the correctness of APR-generated patches via semantic and syntactic reasoning. INVALIDATOR reasons about program semantic via program invariants while it also captures program syntax via language semantic learned from large code corpus using the pre-trained language model. Given a buggy program and the developer-patched program, INVALIDATOR infers likely invariants on both programs. Then, INVALIDATOR determines that a APR-generated patch overfits if: (1) it violates correct specifications or (2) maintains errors behaviors of the original buggy program. In case our approach fails to determine an overfitting patch based on invariants, INVALIDATOR utilizes a trained model from labeled patches to assess patch correctness based on program syntax. The benefit of INVALIDATOR is three-fold. First, INVALIDATOR is able to leverage both semantic and syntactic reasoning to enhance its discriminant capability. Second, INVALIDATOR does not require new test cases to be generated but instead only relies on the current test suite and uses invariant inference to generalize the behaviors of a program. Third, INVALIDATOR is fully automated. We have conducted our experiments on a dataset of 885 patches generated on real-world programs in Defects4J. Experiment results show that INVALIDATOR correctly classified 79 more overfitting patches being detected by the best baseline. INVALIDATOR also substantially outperforms the best baselines by 14 Accuracy and F-Measure, respectively.

READ FULL TEXT

page 5

page 11

page 15

research
03/01/2023

PatchZero: Zero-Shot Automatic Patch Correctness Assessment

Automated Program Repair (APR) techniques have shown more and more promi...
research
03/25/2020

Patch Quality and Diversity of Invariant-Guided Search-Based Program Repair

Most automatic program repair techniques rely on test cases to specify c...
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
10/26/2019

Automated Classification of Overfitting Patches with Statically Extracted Code Features

Automatic program repair (APR) aims to reduce the cost of manually fixin...
research
03/14/2019

Are My Invariants Valid? A Learning Approach

Ensuring that a program operates correctly is a difficult task in large,...
research
07/11/2016

sk_p: a neural program corrector for MOOCs

We present a novel technique for automatic program correction in MOOCs, ...
research
07/28/2021

Checking Patch Behaviour against Test Specification

Towards predicting patch correctness in APR, we propose a simple, but no...

Please sign up or login with your details

Forgot password? Click here to reset