Automatic Generation of Pull Request Descriptions

Zhongxin Liu, Xin Xia, Christoph Treude, David Lo, Shanping Li
9/16/2019
cs.SE

Official code: Tbabm/PRSummarizer (18 stars, Python, MIT, last commit 2022-11-12).

Abstract

Enabled by the pull-based development model, developers can easily contribute to a project through pull requests (PRs). When creating a PR, developers can add a free-form description to describe what changes are made in this PR and/or why.

Show full abstract

Such a description is helpful for reviewers and other developers to gain a quick understanding of the PR without touching the details and may reduce the possibility of the PR being ignored or rejected. However, developers sometimes neglect to write descriptions for PRs. For example, in our collected dataset with over 333K PRs, more than 34% of the PR descriptions are empty. To alleviate this problem, we propose an approach to automatically generate PR descriptions based on the commit messages and the added source code comments in the PRs. We regard this problem as a text summarization problem and solve it using a novel sequence-to-sequence model. To cope with out-of-vocabulary words in software artifacts and bridge the gap between the training loss function of the sequence-to-sequence model and the evaluation metric ROUGE, which has been shown to correspond to human evaluation, we integrate the pointer generator and directly optimize for ROUGE using reinforcement learning and a special loss function. We build a dataset with over 41K PRs and evaluate our approach on this dataset through ROUGE and a human evaluation. Our evaluation results show that our approach outperforms two baselines by significant margins.

View on arXivView PDF

Code Implementations(1)

Tbabm/PRSummarizerOfficial100%
MIT
1814PythonAug 21, 20194 years agoMIT

Similar Papers

Cite this paper

@article{liu2019automatic,
  title  = {Automatic Generation of Pull Request Descriptions},
  author = {Zhongxin Liu and Xin Xia and Christoph Treude and David Lo and Shanping Li},
  year   = {2019},
  eprint = {1909.06987},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1909.06987}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1909.06987.svg)](https://codeofpaper.com/paper/1909.06987)

Discussion