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

被引:77
|
作者
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
基金
中国国家自然科学基金;
关键词
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
相关论文
共 15 条
  • [1] Accelerating Redundancy-Based Program Repair via Code Representation Learning and Adaptive Patch Filtering
    Yang, Chen
    PROCEEDINGS OF THE 29TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE '21), 2021, : 1672 - 1674
  • [2] Patch Correctness Assessment in Automated Program Repair Based on the Impact of Patches on Production and Test Code
    Ghanbari, Ali
    Marcus, Andrian
    PROCEEDINGS OF THE 31ST ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2022, 2022, : 654 - 665
  • [3] Identifying Patch Correctness in Test-Based Program Repair
    Xiong, Yingfei
    Liu, Xinyuan
    Zeng, Muhan
    Zhang, Lu
    Huang, Gang
    PROCEEDINGS 2018 IEEE/ACM 40TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2018, : 789 - 799
  • [4] Shibboleth: Hybrid Patch Correctness Assessment in Automated Program Repair
    Ghanbari, Ali
    Marcus, Andrian
    PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,
  • [5] CREX: Predicting patch correctness in automated repair of C programs through transfer learning of execution semantics
    Yan, Dapeng
    Liu, Kui
    Niu, Yuqing
    Li, Li
    Liu, Zhe
    Liu, Zhiming
    Klein, Jacques
    Bissyande, Tegawende F.
    INFORMATION AND SOFTWARE TECHNOLOGY, 2022, 152
  • [6] Rete: Learning Namespace Representation for Program Repair
    Parasaram, Nikhil
    Barr, Earl T.
    Mechtaev, Sergey
    2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 1264 - 1276
  • [7] A hybrid code representation learning approach for predicting method names
    Zhang, Fengyi
    Chen, Bihuan
    Li, Rongfan
    Peng, Xin
    JOURNAL OF SYSTEMS AND SOFTWARE, 2021, 180
  • [8] Predicting bugs in source code changes with incremental learning method
    Yuan, Zi
    Yu, Lili
    Liu, Chao
    Zhang, Linghua
    Journal of Software, 2013, 8 (07) : 1620 - 1633
  • [9] Doctor Code: A machine learning-based approach to program repair
    Moosavi, Sh
    Vahidi-Asl, M.
    Haghighi, H.
    Rezaalipour, M.
    Scientia Iranica, 2024, 31 (02) : 83 - 102
  • [10] A controlled experiment of different code representations for learning-based program repair
    Marjane Namavar
    Noor Nashid
    Ali Mesbah
    Empirical Software Engineering, 2022, 27