Generating Parameter Comments and Integrating with Method Summaries

Generating Parameter Comments and Integrating with Method Summaries
复制标题

DOI:
10.1109/icpc.2011.28
复制
发表时间:
2011-06
期刊:
2011 IEEE 19th International Conference on Program Comprehension
影响因子:
--
通讯作者:
G. Sridhara;L. Pollock;K. Vijay-Shanker
G. Sridhara;L. Pollock;K. Vijay-Shanker
中科院分区:
其他
文献类型:
--
作者:
G. Sridhara;L. Pollock;K. Vijay-Shanker

文献摘要

被引文献

相似文献

方法的前导注释的一个重要部分是方法的形式参数的注释。根据 Java 文档编写指南,开发人员应该编写方法操作的摘要,然后编写每个参数的注释。在本文中,我们描述了一种自动生成 Java 方法参数的描述性注释的新技术。这样生成的注释可以帮助缓解开发人员编写参数注释的缺乏。此外,它们还可以帮助程序员确保参数注释与代码保持一致。我们提出启发式方法来生成注释,这些注释提供了方法中参数的作用的高级概述。我们确保提供足够的上下文,以便开发人员能够理解参数在实现方法的计算意图中的作用。九位经验丰富的开发人员认为,自动生成的方法参数注释是准确的,并提供了参数在实现方法所需功能中的作用的快速概要。
An important part of the leading comments for a method are the comments for the formal parameters of the method. According to the Java documentation writing guidelines, developers should write a summary of the method'sactions followed by comments for each parameter. In this paper, we describe a novel technique to automatically generate descriptive comments for parameters of Java methods. Such generated comments can help alleviate the lack of developer written parameter comments. In addition, they can help a programmer in ensuring that a parameter comment is current with the code. We present heuristics to generate comments that provide a high-level overview of the role of a parameter in a method. We ensure that sufficient context is provided such that a developer can understand the role of the parameter in achieving the computational intent of the method. In the opinion of nine experienced developers, the automatically generated parameter comments for methods are accurate and provide a quick synopsis of the role of the parameter in achieving the desired functionality of the method.