arrow
Return

Context-Aware Code Change Embedding for Better Patch Correctness Assessment

delete2022-05-18
delete37
PRE
AI
B
Bo Lin
S
Shangwen Wang *
文
文明 (Ming Wen) *
X
Xiaoguang Mao
DOI:10.1145/3505247delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Despite the capability in successfully fixing more and more real-world bugs, existing Automated Program Repair (APR) techniques are still challenged by the long-standing overfitting problem (i.e., a generated patch that passes all tests is actually incorrect). Plenty of approaches have been proposed for automated patch correctness assessment (APCA). Nonetheless, dynamic ones (i.e., those that needed to execute tests) are time-consuming while static ones (i.e., those built on top of static code features) are less precise. Therefore, embedding techniques have been proposed recently, which assess patch correctness via embedding token sequences extracted from the changed code of a generated patch. However, existing techniques rarely considered the context information and program structures of a generated patch, which are crucial for patch correctness assessment as revealed by existing studies. In this study, we explore the idea of context-aware code change embedding considering program structures for patch correctness assessment. Specifically, given a patch, we not only focus on the changed code but also take the correlated unchanged part into consideration, through which the context information can be extracted and leveraged. We then utilize the AST path technique for representation where the structure information from AST node can be captured. Finally, based on several pre-defined heuristics, we build a deep learning based classifier to predict the correctness of the patch. We implemented this idea as CACHE and performed extensive experiments to assess its effectiveness. Our results demonstrate that CACHE can (1) perform better than previous representation learning based techniques (e.g., CACHE relatively outperforms existing techniques by approximate to 6%, approximate to 3%, and approximate to 16%, respectively under three diverse experiment settings), and (2) achieve overall higher performance than existing APCA techniques while even being more precise than certain dynamic ones including PATCH-SIM (92.9% vs. 83.0%). Further results reveal that the context information and program structures leveraged by CACHE contributed significantly to its outstanding performance.
Keywords:
Automated program repair
patch correctness
deep learning
Patch Correctness Assessment: A Survey
err2025-01-20
err0
errOAAI
errFei, Zhiwei; Ge, Jidong; Li, Chuanyi; Wang, Tianqi; Li, Yuning; Zhang, Haodong; Huang, Liguo; Luo, Bin
errShare
errSave
Invalidator: Automated Patch Correctness Assessment Via Semantic and Syntactic Reasoning
err2023-01-01
err9
errOAAI
errLe-Cong, Thanh; Luong, Duc-Minh; Le, Xuan Bach D.; Lo, David; Tran, Nhat-Hoa; Quang-Huy, Bui; Huynh, Quyet-Thang
errShare
errSave
RePaCA: Leveraging reasoning large language models for static automated patch correctness assessment
err2026-07-24
err0
errOAAI
errMarcos Fuster-Pena; David de-Fitero-Dominguez; Antonio Garcia-Cabot; Eva Garcia-Lopez
errShare
errSave
Automated patch correctness predicting to fix software defect
err2024-12-01
err0
PREAI
errZheng, Zelong; Wang, Ruihan; Tao, Zijian; Li, Hui; Chen, Chen; Li, Tingting; Guo, Shikai
errShare
errSave
ComPass: Contrastive Learning for Automated Patch Correctness Assessment in Program Repair
err2026-05-30
err0
PREAI
errQuanjun Zhang; Ye Shang; Haichuan Hu; Chunrong Fang; Zhenyu Chen; Liang Xiao
errShare
errSave
The Best of Both Worlds: Combining Learned Embeddings with Engineered Features for Accurate Prediction of Correct Patches
err2023-05-27
err11
errOAAI
errTian, Haoye; Liu, Kui; Li, Yinghua; Kabore, Abdoul Kader; Koyuncu, Anil; Habib, Andrew; Li, Li; Wen, Junhao; Klein, Jacques; Bissyande, Tegawende F.
errShare
errSave
Predicting Patch Correctness Based on the Similarity of Failing Test Cases
err2022-08-22
err20
errOAAI
errTian, Haoye; Li, Yinghua; Pian, Weiguo; Kabore, Abdoul Kader; Liu, Kui; Habib, Andrew; Klein, Jacques; Bissyande, Tegawende F.
errShare
errSave
CREX: Predicting patch correctness in automated repair of C programs through transfer learning of execution semantics
err2022-12-01
err6
errOAAI
errYan, Dapeng; Liu, Kui; Niu, Yuqing; Li, Li; Liu, Zhe; Liu, Zhiming; Klein, Jacques; Bissyande, Tegawende F.
errShare
errSave

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.4K
Citations:
4.5K

Organization

N
national university of defense technology - china
Scholars:
1.8W
Papers: 1.4W
Citations: 1.7W
Cited Papers

Cited Papers

errShare
errSave
Possible role of RKIP in cytotrophoblast migration: immunohistochemical and in vitro studies
err2012-01-23
err0
PREAI
errPasquapina Ciarmela; Daniela Marzioni; Md. Soriful Islam; Peter Clarke Gray; Luigi Terracciano; Teresa Lorenzi; Tullia Todros; Felice Petraglia; Mario Castellucci
errShare
errSave
The effect of a novel extracorporeal cytokine hemoadsorption device on IL-6 elimination in septic patients: A randomized controlled trial
err2017-10-30
err0
errOAAI
errDirk Schädler; Christine Pausch; Daniel Heise; Andreas Meier-Hellmann; Jörg Brederlau; Norbert Weiler; Gernot Marx; Christian Putensen; Claudia Spies; Achim Jörres; Michael Quintel; Christoph Engel; John A. Kellum; Martin K. Kuhlmann
errShare
errSave
errShare
errSave
Ebola virus sequencing protocol v1
err
IF0
err2019-09-25
err0
errOAAI
errJosh Quick
errShare
errSave
errShare
errSave
researcher View more