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

Haoye Tian, Xunzhu Tang, Andrew Habib, Shangwen Wang, Kui Liu +3 more
8/8/2022
cs.SEcs.AI

Official code: Trustworthy-Software/Quatrain (9 stars, Python, MIT, last commit 2023-02-20).

Abstract

In this work, we propose a novel perspective to the problem of patch correctness assessment: a correct patch implements changes that "answer" to a problem posed by buggy behaviour. Concretely, we turn the patch correctness assessment into a Question Answering problem.

Show full abstract

To tackle this problem, our intuition is that natural language processing can provide the necessary representations and models for assessing the semantic correlation between a bug (question) and a patch (answer). Specifically, we consider as inputs the bug reports as well as the natural language description of the generated patches. Our approach, Quatrain, first considers state of the art commit message generation models to produce the relevant inputs associated to each generated patch. Then we leverage a neural network architecture to learn the semantic correlation between bug reports and commit messages. Experiments on a large dataset of 9135 patches generated for three bug datasets (Defects4j, Bugs.jar and Bears) show that Quatrain can achieve an AUC of 0.886 on predicting patch correctness, and recalling 93% correct patches while filtering out 62% incorrect patches. Our experimental results further demonstrate the influence of inputs quality on prediction performance. We further perform experiments to highlight that the model indeed learns the relationship between bug reports and code change descriptions for the prediction. Finally, we compare against prior work and discuss the benefits of our approach.

View on arXivView PDF

Code Implementations(1)

MIT

Quatrain(Question Answering for Patch Correctness Evaluation), a supervised learning approach that exploits a deep NLP model to classify the relatedness of a bug report with a patch description.

93Python, ShellJul 31, 20223 years agoMIT

Similar Papers

Cite this paper

@article{tian2022this,
  title  = {Is this Change the Answer to that Problem? Correlating Descriptions of Bug and Code Changes for Evaluating Patch Correctness},
  author = {Haoye Tian and Xunzhu Tang and Andrew Habib and Shangwen Wang and Kui Liu and Xin Xia and Jacques Klein and Tegawendé F. Bissyandé},
  year   = {2022},
  eprint = {2208.04125},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2208.04125}
}

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/2208.04125.svg)](https://codeofpaper.com/paper/2208.04125)

Discussion