Home > Research > Publications & Outputs > Learning to Represent Patches

Electronic data

  • pdf

    1.38 MB, PDF document

Links

View graph of relations

Learning to Represent Patches

Research output: Working paperPreprint

Published
  • Xunzhu Tang
  • Haoye Tian
  • Zhenghan Chen
  • Weiguo Pian
  • Saad Ezzini
  • Abdoul Kader Kabore
  • Andrew Habib
  • Jacques Klein
  • Tegawende F. Bissyande
Close
Publication date1/08/2023
<mark>Original language</mark>English

Abstract

Patch representation is crucial in automating various software engineering tasks, like determining patch accuracy or summarizing code changes. While recent research has employed deep learning for patch representation, focusing on token sequences or Abstract Syntax Trees (ASTs), they often miss the change's semantic intent and the context of modified lines. To bridge this gap, we introduce a novel method, Patcherizer. It delves into the intentions of context and structure, merging the surrounding code context with two innovative representations. These capture the intention in code changes and the intention in AST structural modifications pre and post-patch. This holistic representation aptly captures a patch's underlying intentions. Patcherizer employs graph convolutional neural networks for structural intention graph representation and transformers for intention sequence representation. We evaluated Patcherizer's embeddings' versatility in three areas: (1) Patch description generation, (2) Patch accuracy prediction, and (3) Patch intention identification. Our experiments demonstrate the representation's efficacy across all tasks, outperforming state-of-the-art methods. For example, in patch description generation, Patcherizer excels, showing an average boost of 19.39% in BLEU, 8.71% in ROUGE-L, and 34.03% in METEOR scores.