Does the Stream API Benefit from Special Debugging Facilities? A Controlled Experiment on Loops and Streams with Specific Debuggers
Jan Reichl, Stefan Hanenberg, Volker Gruhn
Abstract
Java's Stream API, that massively makes use of lambda expressions, permits a more declarative way of defining operations on collections in comparison to traditional loops. While experimental results suggest that the use of the Stream API has measurable benefits with respect to code readability (in comparison to loops), a remaining question is whether it has other implications. And one of such implications is, for example, tooling in general and debugging in particular because of the following: While the traditional loop-based approach applies filters one after another to single elements, the Stream API applies filters on whole collections. In the meantime there are dedicated debuggers for the Stream API, but it remains unclear whether such a debugger (on the Stream API) has a measurable benefit in comparison to the traditional stepwise debugger (on loops). The present papers introduces a controlled experiment on the debugging of filter operations using a stepwise debugger versus a stream debugger. The results indicate that under the experiment's settings the stream debugger has a significant (<tex>\mathrm{p} < .001</tex>) and large, positive effect <tex></tex>. However, the experiment reveals that additional factors interact with the debugger treatment such as whether or not the failing object is known upfront. The mentioned factor has a strong and large disordinal interaction effect with the debugger (<tex>\mathrm{p} < .001; \eta_{p}^{2}=.928</tex>): In case an object is known upfront that can be used to identify a failing filter, the stream debugger is even less efficient than the stepwise debugger <tex></tex>. Hence, while we found overall a positive effect of the stream debugger, the answer whether or not debugging is easier on loops or streams cannot be answered without taking the other variables into account. Consequently, we see a contribution of the present paper not only in the comparison of different debuggers but in the identification of additional factors.
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get daca1bf8-aea3-4215-a4dc-c53c4179dd47Related papers
- Imperative versus Declarative Collection Processing: An RCT on the Understandability of Traditional Loops versus the Stream API in JavaNils Mehlhorn, Stefan HanenbergICSE 2022 · 4 citations
- A Study on the Pythonic Functional Constructs' UnderstandabilityCyrine Zid, Fiorella Zampetti, Giuliano Antoniol, Massimiliano Di PentaICSE 2024 · 4 citations
- Eliminating abstraction overhead of Java stream pipelines using ahead-of-time program optimizationAnders Møller, Oskar Haarklou VeileborgOOPSLA 2020 · 9 citations
- Why Do Developers Remove Lambda Expressions in Java?Mingwei Zheng, Jun Yang, Ming Wen, Hengcheng Zhu et al.ASE 2021 · 9 citations
- JEDI: Java Evaluation of Declarative and Imperative Queries: Benchmarking the Java Stream APIFilippo Schiavio, Walter BinderICSE 2026
