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

Author:

Tian Haoye1,Liu Kui2,Li Yinghua1,Kaboré Abdoul Kader1,Koyuncu Anil3,Habib Andrew1,Li Li4,Wen Junhao5,Klein Jacques1,Bissyandé Tegawendé F.1

Affiliation:

1. University of Luxembourg, Luxembourg

2. Huawei, China

3. Sabanci University, Turkey

4. Monash University, Australia

5. Chongqing University, China

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. While the state of the art explores research directions that require dynamic information or rely on manually-crafted heuristics, we study the benefit of learning code representations in order to learn deep features that may encode the properties of patch correctness. 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.

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Reference76 articles.

1. Miltiadis Allamanis , Earl  T. Barr , Premkumar  T. Devanbu , and Charles  A. Sutton . 2018. A Survey of Machine Learning for Big Code and Naturalness. Comput. Surveys 51, 4 ( 2018 ), 81:1–81:37. DOI: https://doi.org/10.1145/3212695 10.1145/3212695 Miltiadis Allamanis, Earl T. Barr, Premkumar T. Devanbu, and Charles A. Sutton. 2018. A Survey of Machine Learning for Big Code and Naturalness. Comput. Surveys 51, 4 (2018), 81:1–81:37. DOI: https://doi.org/10.1145/3212695

2. code2vec: learning distributed representations of code

3. Getafix: learning to fix bugs automatically

4. The plastic surgery hypothesis

5. Testing and Verification of Compilers (Dagstuhl Seminar 17502);Chen Junjie;Dagstuhl Reports,2017

Cited by 5 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. A method to identify overfitting program repair patches based on expression tree;Science of Computer Programming;2024-07

2. APPT: Boosting Automated Patch Correctness Prediction via Fine-Tuning Pre-Trained Models;IEEE Transactions on Software Engineering;2024-03

3. Automatic recognizing relevant fragments of APIs using API references;Automated Software Engineering;2023-11-19

4. Boosting Patch Correctness Checking via Combining Code-Edit Embeddings as Additional What-to-Change Information;2023 IEEE International Conference on Web Intelligence and Intelligent Agent Technology (WI-IAT);2023-10-26

5. Potential Solutions to Challenges in C Program Repair: A Practical Perspective;2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE);2023-09-11

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3