Generating Parameter Comments and Integrating with Method Summaries
Author : Sridhara, Giriprasad; Pollock, Lori; Vijay-Shanker, K
Booktitle : International Conference on Program Comprehension
Date : Jun 2011
Publisher : IEEE
Keyword(s) : documentation, software maintenance
Document Type : In Conference Proceedings
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’s actions 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.