ABSTRACT
Studies have shown that good comments can help programmers quickly understand what a method does, aiding program comprehension and software maintenance. Unfortunately, few software projects adequately comment the code. One way to overcome the lack of human-written summary comments, and guard against obsolete comments, is to automatically generate them. In this paper, we present a novel technique to automatically generate descriptive summary comments for Java methods. Given the signature and body of a method, our automatic comment generator identifies the content for the summary and generates natural language text that summarizes the method's overall actions. According to programmers who judged our generated comments, the summaries are accurate, do not miss important content, and are reasonably concise.
- }}T. Ball and J. R. Larus. Branch Prediction for Free. Conf on Programming Language Design and Implementation (PLDI), 1993. Google ScholarDigital Library
- }}D. Binkley, D. Lawrie, S. Maex, and C. Morrell. Impact of Limited Memory Resources. Intl Conf on Program Comprehension (ICPC), 2008. Google ScholarDigital Library
- }}R. P. Buse and W. R. Weimer. Automatic Documentation Inference for Exceptions. Intl Symp on Software Testing and Analysis (ISSTA), 2008. Google ScholarDigital Library
- }}P. P. Chang, S. A. Mahlke, and W. Hwu. Using Profile Information to Assist Classic Code Optimizations. Softw. Practice and Experience, 21(12):1301--1321, 1991. Google ScholarDigital Library
- }}M. E. Crosby, J. Scholtz, and S. Wiedenbeck. The Roles Beacons Play in Comprehension for Novice and Expert Programmers. Workshop of the Psychology of Programming Interest Group (PPIG), 2002.Google Scholar
- }}S. C. B. de Souza, N. Anquetil, and K. M. de Oliveira. A Study of the Documentation Essential to Software Maintenance. Intl Conf on Design of Communication (SIGDOC), 2005. Google ScholarDigital Library
- }}E. Enslen, E. Hill, L. Pollock, and K. Vijay-Shanker. Mining Source Code to Automatically Split Identifiers for Software Analysis. Intl Working Conf on Mining Software Repositories (MSR), 2009. Google ScholarDigital Library
- }}T. E. Erickson. An Automated FORTRAN Documenter. Intl Conf on Systems Documentation (SIGDOC), 1982. Google ScholarDigital Library
- }}M. Fowler. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999. Google ScholarDigital Library
- }}M. Harman, N. Gold, R. Hierons, and D. Binkley. Code Extraction Algorithms which Unify Slicing and Concept Assignment. Working Conf on Reverse Engineering (WCRE), 2002. Google ScholarDigital Library
- }}E. Hill. Integrating Natural Language and Program Structure Information to Improve Software Search and Exploration. PhD thesis, University of Delaware, 2010. Google ScholarDigital Library
- }}E. Hill, Z. P. Fry, H. Boyd, G. Sridhara, Y. Novikova, L. Pollock, and K. Vijay-Shanker. AMAP: Automatically Mining Abbreviation Expansions in Programs to Enhance Software Maintenance Tools. Intl Working Conf on Mining Software Repositories (MSR), 2008. Google ScholarDigital Library
- }}E. Hill, L. Pollock, and K. Vijay-Shanker. Automatically Capturing Source Code Context of NL-Queries for Software Maintenance and Reuse. Intl Conf on Software Engineering (ICSE), 2009. Google ScholarDigital Library
- }}M. Kajko-Mattsson. A Survey of Documentation Practice within Corrective Maintenance. Empirical Softw. Eng., 10(1):31--55, 2005. Google ScholarDigital Library
- }}D. E. Knuth. Literate Programming. The Computer Journal, 27(2), 1984. Google ScholarDigital Library
- }}B. Liblit, A. Begel, and E. Sweetser. Cognitive Perspectives on the Role of Naming in Computer Programs. Psychology of Programming Workshop (PPIG), 2006.Google Scholar
- }}F. Long, X. Wang, and Y. Cai. API Hyperlinking via Structural Overlap. Foundations of Software Engineering (FSE), 2009. Google ScholarDigital Library
- }}I. Mani. Automatic Summarization. John Benjamins, 2001.Google Scholar
- }}D. P. Marin. What Motivates Programmers to Comment? Master's thesis, University of California, Berkeley, 2005.Google Scholar
- }}D. G. Novick and K. Ward. What Users Say They Want in Documentation. Intl Conf on Design of Communication (SIGDOC), 2006. Google ScholarDigital Library
- }}E. Reiter and R. Dale. Building Natural Language Generation Systems. Cambridge Univ. Press, 2000. Google ScholarCross Ref
- }}D. Roach, H. Berghel, and J. R. Talburt. An Interactive Source Commenter for Prolog Programs. SIGDOC Asterisk J. Comput. Doc., 14(4), 1990. Google ScholarDigital Library
- }}P. N. Robillard. Schematic Pseudocode for Program Constructs and its Computer Automation by SCHEMACODE. Commun. ACM, 29(11), 1986. Google ScholarDigital Library
- }}R. C. Seacord, D. Plakosh, and G. A. Lewis. Modernizing Legacy Systems: Software Technologies, Engineering Process and Business Practices. Addison-Wesley Longman Publishing Co., Inc., 2003. Google ScholarDigital Library
- }}M. J. Sousa. A Survey on the Software Maintenance Process. International Conference on Software Maintenance (ICSM), 1998. Google ScholarDigital Library
- }}G. Sridhara, E. Hill, L. Pollock, and K. Vijay-Shanker. Identifying Word Relations in Software: A Comparative Study of Semantic Similarity Tools. Intl Conf on Program Comprehension (ICPC), 2008. Google ScholarDigital Library
- }}M.-A. Storey. Theories, Methods and Tools in Program Comprehension: Past, Present and Future. Intl Workshop on Program Comprehension (IWPC), 2005. Google ScholarDigital Library
- }}SUN. Code Conventions for the Java Programming Language - Naming Conventions. online. http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html.Google Scholar
- }}SUN. How to Write Doc Comments for the Javadoc Tool. online. http://java.sun.com/j2se/javadoc/writingdoccomments/.Google Scholar
- }}A. A. Takang, P. A. Grubb, and R. D. Macredie. The Effects of Comments and Identifier Names on Program Comprehensibility: An Experimental Investigation. J. Prog. Lang., 4(3), 1996.Google Scholar
- }}T. Tenny. Program Readability: Procedures Versus Comments. Trans. Softw. Eng., 14(9), 1988. Google ScholarDigital Library
- }}S. N. Woodfield, H. E. Dunsmore, and V. Y. Shen. The Effect of Modularization and Comments on Program Comprehension. Intl Conf on Software Engineering (ICSE), 1981. Google ScholarDigital Library
Index Terms
- Towards automatically generating summary comments for Java methods
Recommendations
Generating comments from source code with CCGs
NL4SE 2018: Proceedings of the 4th ACM SIGSOFT International Workshop on NLP for Software EngineeringGood comments help developers understand software faster and provide better maintenance. However, comments are often missing, generally inaccurate, or out of date. Many of these problems can be avoided by automatic comment generation. This paper ...
A Comparative Study on Method Comment and Inline Comment
Code comments are one of the important documents to help developers review and comprehend source code. In recent studies, researchers have proposed many deep learning models to generate the method header comments (i.e., method comment), which have ...
Topic-driven reader comments summarization
CIKM '12: Proceedings of the 21st ACM international conference on Information and knowledge managementReaders of a news article often read its comments contributed by other readers. By reading comments, readers obtain not only complementary information about this news article but also the opinions from other readers. However, the existing ranking ...
Comments