Automatic Generation of Descriptive Summary Comments for Methods in Object-oriented Programs

Author : Sridhara, Giriprasad
Date : Jan 2012
Advisor : Pollock, Lori
Institution : University of Delaware
Department : Computer and Information Sciences
Keyword(s) : comment generation, natural language program analysis
Document Type : Ph.D. Thesis

Abstract :

A software system is typically developed in a number of different phases viz., analysis, design, coding and testing. Once the software is released to the customer, it enters a phase known as maintenance. It is well established that software maintenance takes an inordinate amount of the overall resources spent on a software project during its life cycle. It is estimated that 60 to 90% of the overall costs of software development are due to maintenance. An important reason for the surprisingly exorbitant costs of maintenance is the difficulty associated with understanding the software. Software must be understood sufficiently to perform a required maintenance task correctly. Several studies have suggested that comments describing the code can help mitigate the burden of program understanding. However, studies also suggest that there is a dearth of comments in software systems. Even in systems with many comments, the comments tend to be obsolete with respect to the code, thus rendering them not only useless but also potentially dangerous. This dissertation addresses the issue of a dearth of comments, by automatically generating comments. Such generated comments can also ensure that developers can avoid the tedious task of updating comments, which they often forget to do in the rush to complete a maintenance task. Thus, automatically generating comments can also decrease the number of comments that are not up to date with the code. An underlying hypothesis of this research project is that succinct natural language descriptions of source code fragments, presented in the form of comments, can reduce the amount of code to be read by the developer. This in turn decreases the time required to understand the code. By relying upon the generated succinct descriptions, a developer can quickly lter out code that is not germane to the current maintenance task and focus all his attention on the relevant code. In particular, this dissertation focuses on automatically: (1) generating comments that summarize a given Java method, (2) identifying groupings of statements within a method that collectively implement a high-level action and generating a succinct description of the high-level action, and (3) generating comments that provide a high-level overview of a parameter’s role in a method.

Paper Link