The Best of Both Worlds: Combining Learned Embeddings with Engineered Features for Accurate Prediction of Correct Patches

Haoye Tian, Kui Liu, Yinghua Li, Abdoul Kader Kaboré, Anil Koyuncu +5 more
3/16/2022
cs.SE

Official code: HaoyeTianCoder/Panther (6 stars, Python, MIT, last commit 2023-02-20).

Abstract

A large body of the literature on automated program repair develops approaches where patches are automatically generated to be validated against an oracle (e.g., a test suite). Because such an oracle can be imperfect, the generated patches, although validated by the oracle, may actually be incorrect.

Show full abstract

Our empirical work investigates different representation learning approaches for code changes to derive embeddings that are amenable to similarity computations of patch correctness identification, and assess the possibility of accurate classification of correct patch by combining learned embeddings with engineered features. Experimental results demonstrate the potential of learned embeddings to empower Leopard (a patch correctness predicting framework implemented in this work) with learning algorithms in reasoning about patch correctness: a machine learning predictor with BERT transformer-based learned embeddings associated with XGBoost achieves an AUC value of about 0.803 in the prediction of patch correctness on a new dataset of 2,147 labeled patches that we collected for the experiments. Our investigations show that deep learned embeddings can lead to complementary/better performance when comparing against the state-of-the-art, PATCH-SIM, which relies on dynamic information. By combining deep learned embeddings and engineered features, Panther (the upgraded version of Leopard implemented in this work) outperforms Leopard with higher scores in terms of AUC, +Recall and -Recall, and can accurately identify more (in)correct patches that cannot be predicted by the classifiers only with learned embeddings or engineered features. Finally, we use an explainable ML technique, SHAP, to empirically interpret how the learned embeddings and engineered features are contributed to the patch correctness prediction.

View on arXivView PDF

Code Implementations(1)

MIT

A patch correctness predicting framework

61Python, ShellAug 23, 20203 years agoMIT

Similar Papers

Cite this paper

@article{tian2022best,
  title  = {The Best of Both Worlds: Combining Learned Embeddings with Engineered Features for Accurate Prediction of Correct Patches},
  author = {Haoye Tian and Kui Liu and Yinghua Li and Abdoul Kader Kaboré and Anil Koyuncu and Andrew Habib and Li Li and Junhao Wen and Jacques Klein and Tegawendé F. Bissyandé},
  year   = {2022},
  eprint = {2203.08912},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.08912}
}

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

Discussion