一句话:提出基于 commit message 与代码注释的 seq2seq 方法,自动生成 Pull Request 描述。
Pull Request(PR)描述有助于评审者快速理解变更,但大量 PR 缺少描述:在 333K+ PR 数据集中超过 34% 为空。论文将 PR 描述生成视为文本摘要任务,以 PR 中的 commit message 和新增加的源码注释为输入,采用序列到序列模型,并针对软件工件中的未登录词引入指针生成器(pointer generator),同时用强化学习和特殊损失函数直接优化 ROUGE。作者构建了超过 41K 个 PR 的数据集,用 ROUGE 和人工评估验证;结果表明该方法在两个基线上均有显著提升。
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. 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.
DOI 原文 ·
@inproceedings{paperbot5293,
title = {Automatic Generation of Pull Request Descriptions},
author = {Zhongxin Liu and Xin Xia and Christoph Treude and David Lo and Shanping Li},
booktitle = {ASE},
year = {2019},
doi = {10.1109/ase.2019.00026}
}