arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2107.07112cs.SEcs.AI
收藏

关于神经代码概括的评价

On the Evaluation of Neural Code Summarization

Xi’an Jiaotong University(西安交通大学);Microsoft Research(微软研究院);Tianjin University(天津大学);The University of Newcastle(纽卡斯尔大学)

Ensheng Shi, Yanlin Wang, Lun Du, Junjie Chen, Shi Han, Hongyu Zhang, Dongmei Zhang, Hongbin Sun

摘要:

源代码摘要对于程序的理解和维护非常重要。然而,有很多程序缺少、过时或不匹配的摘要。最近,已经利用深度学习技术来自动生成给定代码片段的摘要。为了深入了解我们离解决这个问题还有多远,并为未来的研究提供建议,本文对5种最先进的神经代码摘要模型进行了系统和深入的分析,包括6种广泛使用的BLEU变体,4种预处理操作及其组合,以及3种广泛使用的数据集。评价结果表明,一些重要因素对模型的评价有很大的影响,特别是对模型的性能和模型之间的排名。然而,这些因素很容易被忽视。具体地,(1)在评估代码摘要模型的现有工作中广泛使用的BLEU度量具有许多变体。忽略这些变体之间的差异可能会极大地影响所声称结果的有效性。此外,我们进行了人类评估,发现指标BLEU-DC与人类感知最相关;(2)代码预处理选择对摘要性能有很大的影响(从-18\%到+25\%),不应被忽视。我们还探索了预处理组合的聚合,并提高模型的性能;(3)数据集的一些重要特征(语料库大小,数据分割方法和重复率)对模型评估有显着影响。基于实验结果,我们给出了可操作的建议,评估代码摘要,并选择最佳的方法,在不同的场景。我们还建立了一个共享的代码摘要工具箱,以方便未来的研究。

英文摘要:

Source code summaries are important for program comprehension and maintenance. However, there are plenty of programs with missing, outdated, or mismatched summaries. Recently, deep learning techniques have been exploited to automatically generate summaries for given code snippets. To achieve a profound understanding of how far we are from solving this problem and provide suggestions to future research, in this paper, we conduct a systematic and in-depth analysis of 5 state-of-the-art neural code summarization models on 6 widely used BLEU variants, 4 pre-processing operations and their combinations, and 3 widely used datasets. The evaluation results show that some important factors have a great influence on the model evaluation, especially on the performance of models and the ranking among the models. However, these factors might be easily overlooked. Specifically, (1) the BLEU metric widely used in existing work of evaluating code summarization models has many variants. Ignoring the differences among these variants could greatly affect the validity of the claimed results. Furthermore, we conduct human evaluations and find that the metric BLEU-DC is most correlated to human perception; (2) code pre-processing choices can have a large (from -18\% to +25\%) impact on the summarization performance and should not be neglected. We also explore the aggregation of pre-processing combinations and boost the performance of models; (3) some important characteristics of datasets (corpus sizes, data splitting methods, and duplication ratios) have a significant impact on model evaluation. Based on the experimental results, we give actionable suggestions for evaluating code summarization and choosing the best method in different scenarios. We also build a shared code summarization toolbox to facilitate future research.

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

↑