arrow
Return

Multi-grained contextual code representation learning for commit message generation

delete2024-03-01
delete3
PRE
AI
C
Chuangwei Wang
L
Li Zhang
章晓芳 cover
章晓芳 (Xiaofang Zhang) *
DOI:10.1016/j.infsof.2023.107393delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Commit messages, precisely describing the code changes for each commit in natural language, makes it possible for developers and succeeding reviewers to understand the code changes without digging into implementation details. However, the semantic and structural gap between code and natural language poses a significant challenge for commit message generation. Several researchers have proposed automated techniques to generate commit messages. Nevertheless, the information about the code is not sufficiently exploited. In this paper, we propose multi-grained contextual code representation learning for commit message generation (COMU). We extract multi-grained information from the changed code at the line and AST levels (i.e., Code_Diff and AST_Diff). In Code_Diff, we construct global contextual semantic information about the changed code, and mark whether a line of code has changed with three different tokens. In AST_Diff, we extract the code structure from source code changes and combine the extracted structure with four types of editing operations to explicitly focus on the detailed information of the changed part. In addition, we build the experimental datasets, since there is still no publicly sufficient dataset for this task. The release of this dataset would contribute to advancing research in this field. We perform an extensive experiment to evaluate the effectiveness of COMU. The experimental evaluation and human study show that our model outperforms the baseline model.
Keywords:
Code change
Code representation learning
Commit message generation
Pre-training

Journal

Information and Software Technology cover
Information and Software Technology
IF:
4.3
Papers:
3.8K
Citations:
7.7K

Organization

S
soochow university - china
Scholars:
5.2W
Papers: 3.6W
Citations: 82
Cited Papers

Cited Papers

CoreGen: Contextualized Code Representation Learning for Commit Message Generation
err2021-10-01
err25
errOAAI
errNie, Lun Yiu; Gao, Cuiyun; Zhong, Zhicong; Lam, Wai; Liu, Yang; Xu, Zenglin
errShare
errSave
errShare
errSave
On the Naturalness of Software
err2016-04-26
err164
PREAI
errHindle, Abram; Barr, Earl T.; Gabel, Mark; Su, Zhendong; Devanbu, Premkumar
errShare
errSave
Seml: A Semantic LSTM Model for Software Defect Prediction
err2019-01-01
err65
errOAAI
errLiang, Hongliang; Yu, Yue; Jiang, Lin; Xie, Zhuosi
errShare
errSave
A Systematic Literature Review on the Use of Deep Learning in Software Engineering Research
err2022-03-04
err54
errOAAI
errWatson, Cody; Cooper, Nathan; Palacio, David Nader; Moran, Kevin; Poshyvanyk, Denys
errShare
errSave
no more