一句话:提出用代码语义分析预处理代码变更,显著提升神经机器翻译生成提交信息的质量。
提交信息对代码理解至关重要,但开发者常写得不理想;神经机器翻译(NMT)可用于自动生成提交信息,然而现有方法生成质量仍不尽如人意。本文不改进 NMT 算法本身,而是强调将代码变更预处理为简洁输入对训练 NMT 至关重要,并通过代码语义分析实现这一预处理。作者收集了 5 万余条流行 Java 项目提交的真实数据集,并进行综合实验。结果表明,结合代码语义分析的输入预处理能显著提升 NMT 生成提交信息的效果。该工作为如何将机器学习社区设计的 DNN(如 NMT 模型)应用于软件工程任务提供了启示。
It has been long suggested that commit messages can greatly facilitate code comprehension. However, developers may not write good commit messages in practice. Neural machine translation (NMT) has been suggested to automatically generate commit messages. Despite the efforts in improving NMT algorithms, the quality of the generated commit messages is not yet satisfactory. This paper, instead of improving NMT algorithms, suggests that proper preprocessing of code changes into concise inputs is quite critical to train NMT. We approach it with semantic analysis of code changes. We collect a real-world dataset with 50k+ commits of popular Java projects, and verify our idea with comprehensive experiments. The results show that preprocessing inputs with code semantic analysis can improve NMT significantly. This work sheds light to how to apply existing DNNs designed by the machine learning community, e.g., NMT models, to complete software engineering tasks.
DOI 原文 ·
@inproceedings{paperbot5225,
title = {Boosting Neural Commit Message Generation with Code Semantic Analysis},
author = {Shuyao Jiang},
booktitle = {ASE},
year = {2019},
doi = {10.1109/ase.2019.00162}
}