Predicting Patch Correctness Based on the Similarity of Failing Test Cases
Haoye Tian, Yinghua Li, Weiguo Pian, Abdoul Kader Kabor\'e, Kui Liu,, Andrew Habib, Jacques Klein, Tegawend\'e F. Bissyande

TL;DR
This paper introduces BATS, an unsupervised system that predicts patch correctness by analyzing the similarity of failing test cases and their associated patches, outperforming prior supervised methods.
Contribution
The paper proposes a novel unsupervised approach, BATS, leveraging deep code embeddings to predict patch correctness without large labeled datasets.
Findings
BATS achieves an AUC of 0.557 to 0.718 in correctness prediction.
BATS outperforms state-of-the-art methods in patch correctness prediction.
BATS improves recall when combined with supervised approaches.
Abstract
Towards predicting patch correctness in APR, we propose a simple, but novel hypothesis on how the link between the patch behaviour and failing test specifications can be drawn: similar failing test cases should require similar patches. We then propose BATS, an unsupervised learning-based system to predict patch correctness by checking patch Behaviour Against failing Test Specification. BATS exploits deep representation learning models for code and patches: for a given failing test case, the yielded embedding is used to compute similarity metrics in the search for historical similar test cases in order to identify the associated applied patches, which are then used as a proxy for assessing generated patch correctness. Experimentally, we first validate our hypothesis by assessing whether ground-truth developer patches cluster together in the same way that their associated failing test…
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 Engineering Research · Advanced Malware Detection Techniques · Software Reliability and Analysis Research
