Programs documentation is very useful to programmers during maintenance tasks, especially for program comprehension. However, the documentation is not always available or it may be badly written. In such cases, redocumentation becomes so necessary.
In this work, we propose a redocumentation technique that consists in generating comments by using extraction summary techniques.
For this purpose, we conducted an empirical study to analyze the quantitave and qualitative aspects of comments. Particularly, we were interested in studying comment distribution over different types of construct and studying the frequency of documentation for each construct type. We propose a comment taxonomy to classify them according to their content and quality.
Given the results of the empirical study, we decided to summarize Java classes by extracting the comments of methods and constructors. We defined several heuristics in order to determine the most relevant comments to be extracted. After that, we applied these heuristics to Java classes from three projects in order to generate summaries. Finally, we compared the generated summaries (generated comments) to the reference ones (original comments) by using the metric ROUGE.