Automatic Commit Message Generation: A Critical Review and Directions for Future Work
Open Access
- 12 February 2024
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 50 (4) , 816-835
Abstract
Commit messages are critical for code comprehension and software maintenance. Writing a high-quality message requires skill and effort. To support developers and reduce their effort on this task, several approaches have been proposed to automatically generate commit messages. Despite the promising performance reported, we have identified three significant and prevalent threats in these automated approaches: 1) the datasets used to train and evaluate these approaches contain a considerable amount of ‘noise’; 2) current approaches only consider commits of a limited diff size; and 3) current approaches can only generate the subject of a commit message, not the message body. The first limitation may let the models ‘learn’ inappropriate messages in the training stage, and also lead to inflated performance results in their evaluation. The other two threats can considerably weaken the practical usability of these approaches. Further, with the rapid emergence of large language models (LLMs) that show superior performance in many software engineering tasks, it is worth asking: can LLMs address the challenge of long diffs and whole message generation? This article first reports the results of an empirical study to assess the impact of these three threats on the performance of the state-of-the-art auto generators of commit messages. We collected commit data of the Top 1,000 most-starred Java projects in GitHub and systematically removed noisy commits with bot-submitted and meaningless messages. We then compared the performance of four approaches representative of the state-of-the-art before and after the removal of noisy messages, or with different lengths of commit diffs. We also conducted a qualitative survey with developers to investigate their perspectives on simply generating message subjects. Finally, we evaluate the performance of two representative LLMs, namely UniXcoder and ChatGPT, in generating more practical commit messages. The results demonstrate that generating commit messages is of great practical value, considerable work is needed to mature the current state-of-the-art, and LLMs can be an avenue worth trying to address the current limitations. Our analyses provide insights for future work to achieve better performance in practice.Keywords
Funding Information
- National Natural Science Foundation of China (62141209, 62202048, 62232003)
- Science Foundation Ireland (13/RC/2094-P2)
This publication has 63 references indexed in Scilit:
- A large-scale empirical study of commit message generation: models, datasets and evaluationEmpirical Software Engineering, 2022
- CoreGen: Contextualized Code Representation Learning for Commit Message GenerationNeurocomputing, 2021
- Bots Don’t Mind Waiting, Do They? Comparing the Interaction With Automatically and Manually Created Pull Requests2021
- A ground-truth dataset and classification model for detecting bots in GitHub issue and PR commentsJournal of Systems and Software, 2021
- Towards an Autonomous Bot for Automatic Source Code Refactoring2019
- Should I Stale or Should I Close? An Analysis of a Bot That Closes Abandoned Issues and Pull Requests2019
- Developer Dynamics and Syntactic Quality of Commit Messages in OSS Projects2018
- Mining Version Control System for Automatically Generating Commit Comment2017
- Towards Automatic Generation of Short Summaries of Commits2017
- On Automatic Summarization of What and Why Information in Source Code Changes2016