skip to main content
10.1145/1858996.1859006acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
research-article

Towards automatically generating summary comments for Java methods

Published:20 September 2010Publication History

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.

References

  1. }}T. Ball and J. R. Larus. Branch Prediction for Free. Conf on Programming Language Design and Implementation (PLDI), 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}D. Binkley, D. Lawrie, S. Maex, and C. Morrell. Impact of Limited Memory Resources. Intl Conf on Program Comprehension (ICPC), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}R. P. Buse and W. R. Weimer. Automatic Documentation Inference for Exceptions. Intl Symp on Software Testing and Analysis (ISSTA), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}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 ScholarGoogle Scholar
  6. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. }}T. E. Erickson. An Automated FORTRAN Documenter. Intl Conf on Systems Documentation (SIGDOC), 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}M. Fowler. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}E. Hill. Integrating Natural Language and Program Structure Information to Improve Software Search and Exploration. PhD thesis, University of Delaware, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}M. Kajko-Mattsson. A Survey of Documentation Practice within Corrective Maintenance. Empirical Softw. Eng., 10(1):31--55, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}D. E. Knuth. Literate Programming. The Computer Journal, 27(2), 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}B. Liblit, A. Begel, and E. Sweetser. Cognitive Perspectives on the Role of Naming in Computer Programs. Psychology of Programming Workshop (PPIG), 2006.Google ScholarGoogle Scholar
  17. }}F. Long, X. Wang, and Y. Cai. API Hyperlinking via Structural Overlap. Foundations of Software Engineering (FSE), 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}I. Mani. Automatic Summarization. John Benjamins, 2001.Google ScholarGoogle Scholar
  19. }}D. P. Marin. What Motivates Programmers to Comment? Master's thesis, University of California, Berkeley, 2005.Google ScholarGoogle Scholar
  20. }}D. G. Novick and K. Ward. What Users Say They Want in Documentation. Intl Conf on Design of Communication (SIGDOC), 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}E. Reiter and R. Dale. Building Natural Language Generation Systems. Cambridge Univ. Press, 2000. Google ScholarGoogle ScholarCross RefCross Ref
  22. }}D. Roach, H. Berghel, and J. R. Talburt. An Interactive Source Commenter for Prolog Programs. SIGDOC Asterisk J. Comput. Doc., 14(4), 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. }}P. N. Robillard. Schematic Pseudocode for Program Constructs and its Computer Automation by SCHEMACODE. Commun. ACM, 29(11), 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  25. }}M. J. Sousa. A Survey on the Software Maintenance Process. International Conference on Software Maintenance (ICSM), 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. }}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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. }}M.-A. Storey. Theories, Methods and Tools in Program Comprehension: Past, Present and Future. Intl Workshop on Program Comprehension (IWPC), 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. }}SUN. Code Conventions for the Java Programming Language - Naming Conventions. online. http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html.Google ScholarGoogle Scholar
  29. }}SUN. How to Write Doc Comments for the Javadoc Tool. online. http://java.sun.com/j2se/javadoc/writingdoccomments/.Google ScholarGoogle Scholar
  30. }}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 ScholarGoogle Scholar
  31. }}T. Tenny. Program Readability: Procedures Versus Comments. Trans. Softw. Eng., 14(9), 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. }}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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Towards automatically generating summary comments for Java methods

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      ASE '10: Proceedings of the 25th IEEE/ACM International Conference on Automated Software Engineering
      September 2010
      534 pages
      ISBN:9781450301169
      DOI:10.1145/1858996

      Copyright © 2010 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 20 September 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate82of337submissions,24%

      Upcoming Conference

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader