arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1909.06987cs.SE
收藏

自动生成Pull Request描述

Automatic Generation of Pull Request Descriptions

Zhongxin Liu, Xin Xia, Christoph Treude, David Lo, Shanping Li

摘要:

通过基于拉式的开发模型,开发人员可以通过拉式请求(PR)轻松地为项目做出贡献。在创建PR时,开发人员可以添加自由形式的描述,以描述在此PR中进行了哪些更改和/或更改的原因。这样的描述有助于评审人员和其他开发人员快速了解PR而不触及细节,并可能减少PR被忽略或拒绝的可能性。然而,开发人员有时会忽略为PR编写描述。例如,在我们收集的超过333 K PR的数据集中,超过34%的PR描述是空的。为了缓解这个问题,我们提出了一种方法来自动生成PR描述的基础上提交的消息和添加的源代码评论的PR。我们把这个问题作为一个文本摘要的问题,并解决它使用一种新的序列到序列模型。为了处理软件工件中的词汇表外的单词,并弥合序列到序列模型的训练损失函数与评估度量ROUGE之间的差距,该评估度量已被证明与人类评估相对应,我们集成了指针生成器,并使用强化学习和特殊的损失函数直接优化ROUGE。我们建立了一个超过41 K 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑