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

Source Code注释自动生成算法与技术综述

A Survey of Automatic Generation of Source Code Comments: Algorithms and Techniques

Xiaotao Song, Hailong Sun, Xu Wang, Jiafei Yan

摘要:

作为源代码文件的一个组成部分,代码注释有助于提高程序的可读性和可理解性。然而,开发人员有时并没有对他们的程序代码进行充分的注释,这是由于额外的努力,缺乏相关知识,没有意识到代码注释的重要性或其他一些因素。因此,代码注释可能不充分、缺失甚至与源代码不匹配,影响了对软件的理解、重用和维护。为了解决代码注释的这些问题,研究人员一直关注自动生成代码注释。在这项工作中,我们的目标是进行自动代码注释研究的调查。首先,我们概括性地分析了程序注释自动生成的挑战和研究框架。其次,我们给出了代表性算法的分类,每类算法的设计原则,优缺点。同时,我们也提供了一个生成的评论的质量评估的概述。最后,我们总结了一些未来的发展方向,提高技术的自动生成代码注释和质量评估的意见。

英文摘要:

As an integral part of source code files, code comments help improve program readability and comprehension. However, developers sometimes do not comment on their program code adequately due to the incurred extra efforts, lack of relevant knowledge, unawareness of the importance of code commenting or some other factors. As a result, code comments can be inadequate, absent or even mismatched with source code, which affects the understanding, reusing and the maintenance of software. To solve these problems of code comments, researchers have been concerned with generating code comments automatically. In this work, we aim at conducting a survey of automatic code commenting researches. First, we generally analyze the challenges and research framework of automatic generation of program comments. Second, we present the classification of representative algorithms, the design principles, strengths and weaknesses of each category of algorithms. Meanwhile, we also provide an overview of the quality assessment of the generated comments. Finally, we summarize some future directions for advancing the techniques of automatic generation of code comments and the quality assessment of comments.

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

↑