EMNLP 2021main6 citations

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.

BibTeX
@inproceedings{bai-etal-2021-jointly,
    title = "Jointly Learning to Repair Code and Generate Commit Message",
    author = "Bai, Jiaqi  and
      Zhou, Long  and
      Blanco, Ambrosio  and
      Liu, Shujie  and
      Wei, Furu  and
      Zhou, Ming  and
      Li, Zhoujun",
    editor = "Moens, Marie-Francine  and
      Huang, Xuanjing  and
      Specia, Lucia  and
      Yih, Scott Wen-tau",
    booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing",
    month = nov,
    year = "2021",
    address = "Online and Punta Cana, Dominican Republic",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2021.emnlp-main.771/",
    doi = "10.18653/v1/2021.emnlp-main.771",
    pages = "9784--9795"
}
Jointly Learning to Repair Code and Generate Commit Message · EMNLP 2021