Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1109/MSR.2019.00057acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Automatically generating documentation for lambda expressions in Java

Published: 26 May 2019 Publication History

Abstract

When lambda expressions were introduced to the Java programming language as part of the release of Java 8 in 2014, they were the language's first step into functional programming. Since lambda expressions are still relatively new, not all developers use or understand them. In this paper, we first present the results of an empirical study to determine how frequently developers of GitHub repositories make use of lambda expressions and how they are documented. We find that 11% of Java GitHub repositories use lambda expressions, and that only 6% of the lambda expressions are accompanied by source code comments. We then present a tool called LambdaDoc which can automatically detect lambda expressions in a Java repository and generate natural language documentation for them. Our evaluation of LambdaDoc with 23 professional developers shows that they perceive the generated documentation to be complete, concise, and expressive, while the majority of the documentation produced by our participants without tool support was inadequate. Our contribution builds an important step towards automatically generating documentation for functional programming constructs in an object-oriented language.

References

[1]
K. Sharan, Beginning Java 8 Language Features: Lambda Expressions, Inner Classes, Threads, I/O, Collections, and Streams, 1st ed. Berkeley, CA, USA: Apress, 2014.
[2]
T. C. Lethbridge, J. Singer, and A. Forward, "How software engineers use documentation: The state of the practice," IEEE Software, vol. 20, no. 6, pp. 35--39, 2003.
[3]
B. Li, C. Vendome, M. Linares-Vsquez, D. Poshyvanyk, and N. A. Kraft, "Automatically documenting unit test cases," in Proceedings of the International Conference on Software Testing, Verification and Validation, 2016, pp. 341--352.
[4]
M. Linares-Vásquez, B. Li, C. Vendome, and D. Poshyvanyk, "Documenting database usages and schema constraints in database-centric applications," in Proceedings of the International Symposium on Software Testing and Analysis, 2016, pp. 270--281.
[5]
P. Louridas, "Static code analysis," IEEE Software, vol. 23, no. 4, pp. 58--61, 2006.
[6]
E. Kalliamvakou, G. Gousios, K. Blincoe, L. Singer, D. M. German, and D. Damian, "The promises and perils of mining github," in Proceedings of the Working Conference on Mining Software Repositories, 2014, pp. 92--101.
[7]
N. Munaiah, S. Kroh, C. Cabrey, and M. Nagappan, "Curating github for engineered software projects," Empirical Software Engineering, vol. 22, no. 6, pp. 3219--3253, 2017.
[8]
G. A. A. Prana, C. Treude, F. Thung, T. Atapattu, and D. Lo, "Categorizing the content of GitHub README files," Empirical Software Engineering, 2019, to appear.
[9]
J. Cohen, "A coefficient of agreement for nominal scales," Educational and psychological measurement, vol. 20, no. 1, pp. 37--46, 1960.
[10]
J. R. Landis and G. G. Koch, "The measurement of observer agreement for categorical data," Biometrics, pp. 159--174, 1977.
[11]
P. M. Uesbeck, A. Stefik, S. Hanenberg, J. Pedersen, and P. Daleiden, "An empirical study on the impact of c++ lambdas and programmer experience," in Proceedings of the International Conference on Software Engineering, 2016, pp. 760--771.
[12]
R. Khatchadourian and H. Masuhara, "Proactive empirical assessment of new language feature adoption via automated refactoring: The case of java 8 default methods," Programming Journal, vol. 2, no. 3, pp. 6:1--6:30, 2018.
[13]
D. Mazinanian, A. Ketkar, N. Tsantalis, and D. Dig, "Understanding the use of lambda expressions in java," Proceedings of the ACM on Programming Languages, vol. 1, no. OOPSLA, pp. 85:1--85:31, 2017.
[14]
S. C. B. de Souza, N. Anquetil, and K. M. de Oliveira, "A study of the documentation essential to software maintenance," in Proceedings of the Annual International Conference on Design of Communication: Documenting & Designing for Pervasive Information, 2005, pp. 68--75.
[15]
L. Shi, H. Zhong, T. Xie, and M. Li, "An empirical study on evolution of api documentation," in Fundamental Approaches to Software Engineering, D. Giannakopoulou and F. Orejas, Eds., 2011, pp. 416--431.
[16]
B. Fluri, M. Wursch, and H. C. Gall, "Do code and comments co-evolve? on the relation between source code and comment changes," in Proceedings of the Working Conference on Reverse Engineering, 2007, pp. 70--79.
[17]
W. M. Ibrahim, N. Bettenburg, B. Adams, and A. E. Hassan, "On the relationship between comment update practices and software bugs," Journal of Systems and Software, vol. 85, no. 10, pp. 2293--2304, 2012.
[18]
L. Moreno, J. Aponte, G. Sridhara, A. Marcus, L. Pollock, and K. Vijay-Shanker, "Automatic generation of natural language summaries for java classes," in Proceedings of the International Conference on Program Comprehension, 2013, pp. 23--32.
[19]
P. W. McBurney and C. McMillan, "Automatic source code summarization of context for java methods," IEEE Transactions on Software Engineering, vol. 42, no. 2, pp. 103--119, 2016.
[20]
A. T. T. Ying and M. P. Robillard, "Code fragment summarization," in Proceedings of the Joint Meeting on Foundations of Software Engineering, 2013, pp. 655--658.
[21]
R. P. Buse and W. Weimer, "Automatic documentation inference for exceptions," in Proceedings of the International Symposium on Software Testing and Analysis, 2008, pp. 273--282.
[22]
S. Zhang, C. Zhang, and M. D. Ernst, "Automated documentation inference to explain failed tests," in Proceedings of the International Conference on Automated Software Engineering, 2011, pp. 63--72.
[23]
L. Racchetti, L. Tacconi, and C. Fantuzzi, "Generating automatically the documentation from plc code by d4t3 to improve the usability and life cycle management of software in automation," in Proceedings of the International Conference on Automation Science and Engineering, 2015, pp. 168--173.
[24]
M. Hassan and E. Hill, "Toward automatic summarization of arbitrary java statements for novice programmers," in Proceedings of the International Conference on Software Maintenance and Evolution, 2018, pp. 539--543.
[25]
R. P. Buse and W. Weimer, "Automatically documenting program changes," in Proceedings of the International Conference on Automated Software Engineering, 2010, pp. 33--42.
[26]
M. Kim, D. Notkin, D. Grossman, and G. Wilson, "Identifying and summarizing systematic code changes via rule inference," IEEE Transactions on Software Engineering, vol. 39, no. 1, pp. 45--62, 2013.
[27]
M. P. Robillard, A. Marcus, C. Treude, G. Bavota, O. Chaparro, N. Ernst, M. A. Gerosa, M. Godfrey, M. Lanza, M. Linares-Vsquez, G. C. Murphy, L. Moreno, D. Shepherd, and E. Wong, "On-demand developer documentation," in Proceedings of the International Conference on Software Maintenance and Evolution, 2017, pp. 479--483.

Cited By

View all
  • (2023)Assessing the Alignment between the Information Needs of Developers and the Documentation of Programming Languages: A Case Study on RustACM Transactions on Software Engineering and Methodology10.1145/354694532:2(1-48)Online publication date: 4-Apr-2023
  • (2022)A Review on Source Code DocumentationACM Transactions on Intelligent Systems and Technology10.1145/351931213:5(1-44)Online publication date: 21-Jun-2022
  • (2021)Why do developers remove lambda expressions in Java?Proceedings of the 36th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE51524.2021.9678600(67-78)Online publication date: 15-Nov-2021
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
MSR '19: Proceedings of the 16th International Conference on Mining Software Repositories
May 2019
640 pages

Sponsors

Publisher

IEEE Press

Publication History

Published: 26 May 2019

Check for updates

Author Tags

  1. documentation generation
  2. lambda expressions

Qualifiers

  • Research-article

Conference

ICSE '19
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)6
  • Downloads (Last 6 weeks)0
Reflects downloads up to 23 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2023)Assessing the Alignment between the Information Needs of Developers and the Documentation of Programming Languages: A Case Study on RustACM Transactions on Software Engineering and Methodology10.1145/354694532:2(1-48)Online publication date: 4-Apr-2023
  • (2022)A Review on Source Code DocumentationACM Transactions on Intelligent Systems and Technology10.1145/351931213:5(1-44)Online publication date: 21-Jun-2022
  • (2021)Why do developers remove lambda expressions in Java?Proceedings of the 36th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE51524.2021.9678600(67-78)Online publication date: 15-Nov-2021
  • (2019)Does the Introduction of Lambda Expressions Improve the Comprehension of Java Programs?Proceedings of the XXXIII Brazilian Symposium on Software Engineering10.1145/3350768.3350791(187-196)Online publication date: 23-Sep-2019
  • (2019)On the use of lambda expressions in 760 open source Python projectsProceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3338906.3342499(1232-1234)Online publication date: 12-Aug-2019

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