Jointly Learning to Repair Code and Generate Commit Message

Jiaqi Bai, Long Zhou, Ambrosio Blanco, Shujie Liu, Furu Wei, Ming Zhou, Zhoujun Li


Abstract
We propose a novel task of jointly repairing program codes and generating commit messages. Code repair and commit message generation are two essential and related tasks for software development. However, existing work usually performs the two tasks independently. We construct a multilingual triple dataset including buggy code, fixed code, and commit messages for this novel task. We first introduce a cascaded method with two models, one is to generate the fixed code first, and the other generates the commit message based on the fixed and original codes. We enhance the cascaded method with different training approaches, including the teacher-student method, the multi-task method, and the back-translation method. To deal with the error propagation problem of the cascaded method, we also propose a joint model that can both repair the program code and generate the commit message in a unified framework. Massive experiments on our constructed buggy-fixed-commit dataset reflect the challenge of this task and that the enhanced cascaded model and the proposed joint model significantly outperform baselines in both quality of code and commit messages.
Anthology ID:
2021.emnlp-main.771
Volume:
Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing
Month:
November
Year:
2021
Address:
Online and Punta Cana, Dominican Republic
Editors:
Marie-Francine Moens, Xuanjing Huang, Lucia Specia, Scott Wen-tau Yih
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
9784–9795
Language:
URL:
https://aclanthology.org/2021.emnlp-main.771
DOI:
10.18653/v1/2021.emnlp-main.771
Bibkey:
Cite (ACL):
Jiaqi Bai, Long Zhou, Ambrosio Blanco, Shujie Liu, Furu Wei, Ming Zhou, and Zhoujun Li. 2021. Jointly Learning to Repair Code and Generate Commit Message. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9784–9795, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
Cite (Informal):
Jointly Learning to Repair Code and Generate Commit Message (Bai et al., EMNLP 2021)
Copy Citation:
PDF:
https://preview.aclanthology.org/naacl24-info/2021.emnlp-main.771.pdf
Video:
 https://preview.aclanthology.org/naacl24-info/2021.emnlp-main.771.mp4