Nothing Special   »   [go: up one dir, main page]

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

Cited By

View all
  • (2024)Vision Paper: Proof-Carrying Code CompletionsProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering Workshops10.1145/3691621.3694932(35-42)Online publication date: 27-Oct-2024
  • (2024)A Tale of Two Comprehensions? Analyzing Student Programmer Attention during Code SummarizationACM Transactions on Software Engineering and Methodology10.1145/366480833:7(1-37)Online publication date: 26-Aug-2024
  • (2024)Do Code Summarization Models Process Too Much Information? Function Signature May Be All That Is NeededACM Transactions on Software Engineering and Methodology10.1145/365215633:6(1-35)Online publication date: 27-Jun-2024
  • Show More Cited By

Index Terms

  1. Towards automatically generating summary comments for Java methods

    Recommendations

    Comments

    Please enable JavaScript to view thecomments powered by Disqus.

    Information & Contributors

    Information

    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
    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]

    Sponsors

    In-Cooperation

    • IEEE CS

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 20 September 2010

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. comment generation
    2. method summarization
    3. natural language program analysis

    Qualifiers

    • Research-article

    Conference

    ASE10
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 82 of 337 submissions, 24%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)159
    • Downloads (Last 6 weeks)20
    Reflects downloads up to 22 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Vision Paper: Proof-Carrying Code CompletionsProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering Workshops10.1145/3691621.3694932(35-42)Online publication date: 27-Oct-2024
    • (2024)A Tale of Two Comprehensions? Analyzing Student Programmer Attention during Code SummarizationACM Transactions on Software Engineering and Methodology10.1145/366480833:7(1-37)Online publication date: 26-Aug-2024
    • (2024)Do Code Summarization Models Process Too Much Information? Function Signature May Be All That Is NeededACM Transactions on Software Engineering and Methodology10.1145/365215633:6(1-35)Online publication date: 27-Jun-2024
    • (2024)Using Program Comprehension Models to Teach ComprehensibilityProceedings of the 26th Australasian Computing Education Conference10.1145/3636243.3636244(1-10)Online publication date: 29-Jan-2024
    • (2024)An Extractive-and-Abstractive Framework for Source Code SummarizationACM Transactions on Software Engineering and Methodology10.1145/363274233:3(1-39)Online publication date: 14-Mar-2024
    • (2024)Deep Is Better? An Empirical Comparison of Information Retrieval and Deep Learning Approaches to Code SummarizationACM Transactions on Software Engineering and Methodology10.1145/363197533:3(1-37)Online publication date: 15-Mar-2024
    • (2024)Taking ASCII Drawings Seriously: How Programmers Diagram CodeProceedings of the 2024 CHI Conference on Human Factors in Computing Systems10.1145/3613904.3642683(1-16)Online publication date: 11-May-2024
    • (2024)Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)Proceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639183(1-13)Online publication date: 20-May-2024
    • (2024)Esale: Enhancing Code-Summary Alignment Learning for Source Code SummarizationIEEE Transactions on Software Engineering10.1109/TSE.2024.342227450:8(2077-2095)Online publication date: 1-Aug-2024
    • (2024)VarGAN: Adversarial Learning of Variable Semantic RepresentationsIEEE Transactions on Software Engineering10.1109/TSE.2024.339173050:6(1505-1517)Online publication date: 25-Apr-2024
    • Show More Cited By

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media