Evaluating Representation Learning of Code Changes for Predicting Patch Correctness in Program Repair

被引:82
作者
Tian, Haoye [1 ]
Liu, Kui [2 ]
Kabore, Abdoul Kader [1 ]
Koyuncu, Anil [1 ]
Li, Li [3 ]
Klein, Jacques [1 ]
Bissyande, Tegawende F. [1 ]
机构
[1] Univ Luxembourg, Luxembourg, Luxembourg
[2] Nanjing Univ Aeronaut & Astronaut, Nanjing, Peoples R China
[3] Monash Univ, Clayton, Vic, Australia
来源
2020 35TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2020) | 2020年
基金
中国国家自然科学基金;
关键词
Program Repair; Patch Correctness; Distributed Representation Learning; Machine learning; Embeddings; SEARCH;
D O I
10.1145/3324884.3416532
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
A large body of the literature of automated program repair develops approaches where patches are 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 explore research directions that require dynamic information or that 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 mainly investigates different representation learning approaches for code changes to derive embeddings that are amenable to similarity computations. We report on findings based on embeddings produced by pre-trained and re-trained neural networks. Experimental results demonstrate the potential of embeddings to empower learning algorithms in reasoning about patch correctness: a machine learning predictor with BERT transformer-based embeddings associated with logistic regression yielded an AUC value of about 0.8 in the prediction of patch correctness on a deduplicated dataset of 1000 labeled patches. Our investigations show that learned representations can lead to reasonable performance when comparing against the state-of-the-art, PATCH-SIM, which relies on dynamic information. These representations may further be complementary to features that were carefully (manually) engineered in the literature.
引用
收藏
页码:981 / 992
页数:12
相关论文
共 67 条
[1]   A Survey of Machine Learning for Big Code and Naturalness [J].
Allamanis, Miltiadis ;
Barr, Earl T. ;
Devanbu, Premkumar ;
Sutton, Charles .
ACM COMPUTING SURVEYS, 2018, 51 (04)
[2]   Learning Natural Coding Conventions [J].
Allamanis, Miltiadis ;
Barr, Earl T. ;
Bird, Christian ;
Sutton, Charles .
22ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (FSE 2014), 2014, :281-293
[3]   code2vec: Learning Distributed Representations of Code [J].
Alon, Uri ;
Zilberstein, Meital ;
Levy, Omer ;
Yahav, Eran .
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (POPL)
[4]   Getafix: Learning to Fix Bugs Automatically [J].
Bader, Johannes ;
Scott, Andrew ;
Pradel, Michael ;
Chandra, Satish .
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (OOPSLA)
[5]   The Plastic Surgery Hypothesis [J].
Barr, Earl T. ;
Brun, Yuriy ;
Devanbu, Premkumar ;
Harman, Mark ;
Sarro, Federica .
22ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (FSE 2014), 2014, :306-317
[6]  
Chen Junjie, 2017, DAGSTUHL REPORTS, V7, P50, DOI DOI 10.4230/DAGREP.7.12.50
[7]  
Compton Rhys, 2020, P 17 MINING SOFTWARE
[8]  
Csuvik V, 2020, PROCEEDINGS OF THE 2020 IEEE 2ND INTERNATIONAL WORKSHOP ON INTELLIGENT BUG FIXING (IBF '20), P18, DOI [10.1109/ibf50092.2020.9034714, 10.1109/IBF50092.2020.9034714]
[9]  
Devlin J, 2019, 2019 CONFERENCE OF THE NORTH AMERICAN CHAPTER OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS: HUMAN LANGUAGE TECHNOLOGIES (NAACL HLT 2019), VOL. 1, P4171
[10]   Empirical Review of Java']Java Program Repair Tools: A Large-Scale Experiment on 2,141 Bugs and 23,551 Repair Attempts [J].
Durieux, Thomas ;
Madeiral, Fernanda ;
Martinez, Matias ;
Abreu, Rui .
ESEC/FSE'2019: PROCEEDINGS OF THE 2019 27TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2019, :302-313