Downloads provided by UsageCounts
handle: 1822/69124
Background: The Java programming language version eight introduced several features that encourage the functional style of programming, including the support for lambda expressions and the Stream API. Currently, there is common wisdom that refactoring legacy code to introduce lambda expressions, besides other potential benefits, simplifies the code and improves program comprehension. Aims: The purpose of this work is to investigate this belief, conducting an in-depth study to evaluate the effect of introducing lambda expressions on program comprehension. Method: We conduct this research using a mixed-method study. For the quantitative method, we quantitatively analyze 166 pairs of code snippets extracted directly either from GitHub or from recommendations from three tools (RJTL, NetBeans, and IntelliJ). We also surveyed practitioners to collect their perceptions about the benefits on program comprehension when introducing lambda expressions. We asked practitioners to evaluate and rate sets of pairs of code snippets. Results: We found contradictory results in our research. Based on the quantitative assessment, we could not find evidence that the introduction of lambda expressions improves software readability—one of the components of program comprehension. Our results suggest that the transformations recommended by the aforementioned tools decrease program comprehension when assessed by two state-of-the-art models to estimate readability. Differently, our findings of the qualitative assessment suggest that the introduction of lambda expression improves program comprehension in three scenarios: when we convert anonymous inner classes to a lambda expression, structural loops with inner conditional to a anyMatch operator, and structural loops to filter operator combined with a collect method. Implications: We argue in this paper that one can improve program comprehension when she applies particular transformations to introduce lambda expressions (e.g., replacing anonymous inner classes with lambda expressions). Also, the opinion of the participants shines the opportunities in which a transformation for introducing lambda might be advantageous. This might support the implementation of effective tools for automatic program transformations.
FOS: Computer and information sciences, Artificial intelligence, Set (abstract data type), Agile Software Development in Software Engineering, Autonomic Computing and Self-Adaptive Systems, Readability, Program comprehension, Program Comprehension, Empirical Studies, Artificial Intelligence, Java Lambda Expressions, Source code, Code (set theory), Source Code Analysis, Software engineering, Computer science, Programming language, Software Process Improvement, Code refactoring, Computer Science, Physical Sciences, Software system, Comprehension, Java, Software, Empirical Studies in Software Engineering, Information Systems
FOS: Computer and information sciences, Artificial intelligence, Set (abstract data type), Agile Software Development in Software Engineering, Autonomic Computing and Self-Adaptive Systems, Readability, Program comprehension, Program Comprehension, Empirical Studies, Artificial Intelligence, Java Lambda Expressions, Source code, Code (set theory), Source Code Analysis, Software engineering, Computer science, Programming language, Software Process Improvement, Code refactoring, Computer Science, Physical Sciences, Software system, Comprehension, Java, Software, Empirical Studies in Software Engineering, Information Systems
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 4 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Top 10% | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
| views | 20 | |
| downloads | 5 |

Views provided by UsageCounts
Downloads provided by UsageCounts