一句话:提出 ISSUECOMM,将代码片段与 issue 报告关联,为理解代码维护意图提供补充注释。
代码注释对软件开发与维护至关重要。现有注释生成方法主要利用编程经验、源码中的代码-注释对以及相似代码片段的注释,多解释代码“做什么”,却很少解释代码“为何如此开发”。本文引入 issue 报告作为新信息源,其中包含维护类型、症状和修改目的等丰富信息。作者提出首个方法 ISSUECOMM,自动建立代码片段与 issue 报告之间的链接。实验表明,该方法能关联程序员在注释中写出的 70% 以上 issue 编号,且其链接覆盖的 bug 数量是人工注释的 4 倍,其他 issue 数量是人工注释的 10 倍。文中还通过样例说明这些链接有助于描述代码功能与开发目的。
Code comments are vital for software development and maintenance. To supplement the code comments, researchers proposed various approach that generate code comments. The prior approaches take three sources: (1) programming experience, (2) code-comment pairs in source files, and (3) comments of similar code snippets. Most of their generated comments explain code functionalities, but programmers also need comments that explain why a code fragment was developed as it is. To meet the timely needs, in this paper, we introduce a new source, issue reports (e.g. maintenance types, symptoms, and purposes of modifications), to generate code comments. Issue reports contain rich information on how code was maintained. The valuable details of issue reports are useful to understand source code, especially when programmers learn why code was developed in a specific way. Towards this research direction, we propose the first approach, called ISSUECOMM, that builds the links between code fragments and issue reports. Our results show that it links more than 70% issue numbers that are written by programmers in code comments. Furthermore, the links built by our tool covers 4× bugs, and 10× other issues than the links written in manual comments. We present samples of our built links, and explain why our links are useful to describe the functionalities and the purpose of code.
DOI 原文 ·
@inproceedings{paperbot6565,
title = {Understanding Code Fragments with Issue Reports},
author = {Zexuan Li and Hao Zhong},
booktitle = {ASE},
year = {2021},
doi = {10.1109/ase51524.2021.9678864}
}