Correlating Automated and Human Evaluation of Code Documentation Generation Quality

被引:19
作者
Hu, Xing [1 ]
Chen, Qiuyuan [2 ]
Wang, Haoye [2 ]
Xia, Xin [3 ]
Lo, David [4 ]
Zimmermann, Thomas [5 ]
机构
[1] Zhejiang Univ, Sch Software Technol, 1689 Jiangnan Rd, Ningbo 315048, Zhejiang, Peoples R China
[2] Zhejiang Univ, Coll Comp Sci & Technol, Rd 38 West Lake Dist, Hangzhou 310027, Zhejiang, Peoples R China
[3] Monash Univ, Fac Informat Technol, Bldg 6,29 Ancora Imparo Way,Clayton Campus, Clayton, Vic 3800, Australia
[4] Singapore Management Univ, Sch Informat Syst, 80 Stamford Rd, Singapore 178902, Singapore
[5] Microsoft Res, 1 Microsoft Way, Redmond, WA 98052 USA
基金
美国国家科学基金会; 新加坡国家研究基金会;
关键词
Code documentation generation; evaluation metrics; empirical study;
D O I
10.1145/3502853
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Automatic code documentation generation has been a crucial task in the field of software engineering. It not only relieves developers fromwriting code documentation but also helps them to understand programs better. Specifically, deep-learning-based techniques that leverage large-scale source code corpora have been widely used in code documentation generation. These works tend to use automatic metrics (such as BLEU, METEOR, ROUGE, CIDEr, and SPICE) to evaluate different models. These metrics compare generated documentation to reference texts by measuring the overlapping words. Unfortunately, there is no evidence demonstrating the correlation between these metrics and human judgment. We conduct experiments on two popular code documentation generation tasks, code comment generation and commit message generation, to investigate the presence or absence of correlations between these metrics and human judgments. For each task, we replicate three state-of-the-art approaches and the generated documentation is evaluated automatically in terms of BLEU, METEOR, ROUGE-L, CIDEr, and SPICE. We also ask 24 participants to rate the generated documentation considering three aspects (i.e., language, content, and effectiveness). Each participant is given Java methods or commit diffs along with the target documentation to be rated. The results show that the ranking of generated documentation from automatic metrics is different from that evaluated by human annotators. Thus, these automatic metrics are not reliable enough to replace human evaluation for code documentation generation tasks. In addition, METEOR shows the strongest correlation (with moderate Pearson correlation r about 0.7) to human evaluation metrics. However, it is still much lower than the correlation observed between different annotators (with a high Pearson correlation r about 0.8) and correlations that are reported in the literature for other tasks (e.g., Neural Machine Translation [39]). Our study points to the need to develop specialized automated evaluation metrics that can correlate more closely to human evaluation metrics for code generation tasks.
引用
收藏
页数:28
相关论文
共 52 条
[1]  
Alon Uri., 2018, P INT C LEARNING REP
[2]   SPICE: Semantic Propositional Image Caption Evaluation [J].
Anderson, Peter ;
Fernando, Basura ;
Johnson, Mark ;
Gould, Stephen .
COMPUTER VISION - ECCV 2016, PT V, 2016, 9909 :382-398
[3]  
[Anonymous], 2010, P IEEE ACM INT C AUT
[4]  
[Anonymous], 2002, ACM S DOCUMENT ENG
[5]  
Banerjee S, 2005, P ACL WORKSH INTR EX, P65
[6]  
Benesty J, 2009, SPRINGER TOP SIGN PR, V2, P37, DOI 10.1007/978-3-642-00296-0_5
[7]  
Buse R. P. L., 2010, P 25 IEEE ACM INT C, P33
[8]   Why My Code Summarization Model Does NotWork: Code Comment Improvement with Category Prediction [J].
Chen, Qiuyuan ;
Xia, Xin ;
Hu, Han ;
Lo, David ;
Li, Shanping .
ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2021, 30 (02)
[9]  
Chin-Yew L., 2004, Text Summarization Branches Out, 2004, P74
[10]  
Coughlin Deborah., 2003, Proceedings of M T Summit IX, P63