Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning

Thanh Le-Cong, Duc-Minh Luong, Xuan Bach D. Le, David Lo, Nhat-Hoa Tran +2 more
1/3/2023
cs.SEcs.LG

No official code found. Best implementation: thanhlecongg/Invalidator (7 stars, MIT, last commit 2025-09-17).

Abstract

Automated program repair (APR) faces the challenge of test overfitting, where generated patches pass validation tests but fail to generalize. Existing methods for patch assessment involve generating new tests or manual inspection, which can be time-consuming or biased. In this paper, we propose a novel technique, INVALIDATOR, to automatically assess the correctness of APR-generated patches via semantic and syntactic reasoning. INVALIDATOR leverages program invariants to reason about program semantics while also capturing program syntax through language semantics learned from a large code corpus using a pre-trained language model. Given a buggy program and the developer-patched program, INVALIDATOR infers likely invariants on both programs. Then, INVALIDATOR determines that an APR-generated patch overfits if: (1) it violates correct specifications or (2) maintains erroneous behaviors from 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 threefold. First, INVALIDATOR leverages both semantic and syntactic reasoning to enhance its discriminative 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 program behaviors. Third, INVALIDATOR is fully automated. Experimental results demonstrate that INVALIDATOR outperforms existing methods in terms of Accuracy and F-measure, correctly identifying 79% of overfitting patches and detecting 23% more overfitting patches than the best baseline.

View on arXivView PDF

Code Implementations(1)

MIT

Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning (IEEE TSE)

73PythonNov 12, 20221 years agoMIT
automated-program-repairlarge-language-modelsprogram-invariants

Similar Papers

Cite this paper

@article{lecong2023invalidator,
  title  = {Invalidator: Automated Patch Correctness Assessment via Semantic and Syntactic Reasoning},
  author = {Thanh Le-Cong and Duc-Minh Luong and Xuan Bach D. Le and David Lo and Nhat-Hoa Tran and Bui Quang-Huy and Quyet-Thang Huynh},
  year   = {2023},
  eprint = {2301.01113},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2301.01113v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2301.01113.svg)](https://codeofpaper.com/paper/2301.01113)

Discussion