# Automatically Generating Documentation for Lambda Expressions in Java

**Authors:** Anwar Alqaimi, Patanamon Thongtanunam, Christoph Treude

arXiv: 1903.06348 · 2019-03-18

## TL;DR

This paper studies the usage of lambda expressions in Java, finds they are under-documented, and introduces LambdaDoc, a tool that automatically generates natural language documentation for lambda expressions, improving developer understanding.

## Contribution

It provides the first empirical analysis of lambda usage in Java repositories and presents LambdaDoc, a novel tool for automatic documentation generation for lambda expressions.

## Key findings

- 11% of Java GitHub repositories use lambda expressions
- Only 6% of lambda expressions have source code comments
- Developers find LambdaDoc's documentation to be complete and expressive

## 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.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/1903.06348/full.md

---
Source: https://tomesphere.com/paper/1903.06348