There is a newer version of the record available.

Published February 20, 2020 | Version v1
Dataset Open

An Empirical Study on the Use and Misuse of Java 8 Streams

  • 1. City University of New York (CUNY) Hunter College
  • 2. City University of New York (CUNY) Graduate Center
  • 3. Oakland University
  • 4. Columbia University

Description

Streaming APIs allow for big data processing of native data structures by providing MapReduce-like operations over these structures. However, unlike traditional big data systems, these data structures typically reside in shared memory accessed by multiple cores. Although popular, this emerging hybrid paradigm opens the door to possibly detrimental behavior, such as thread contention and bugs related to non-execution and non-determinism. This study explores the use and misuse of a popular streaming API, namely, Java 8 Streams. The focus is on how developers decide whether or not to run these operations sequentially or in parallel and bugs both specific and tangential to this paradigm. Our study involved analyzing 34 Java projects and 5.53 million lines of code, along with 719 manually examined code patches. Various automated, including interprocedural static analysis, and manual methodologies were employed. The results indicate that streams are pervasive, stream parallelization is not widely used, and performance is a crosscutting concern that accounted for the majority of fixes. We also present coincidences that both confirm and contradict the results of related studies. The study advances our understanding of streams, as well as benefits practitioners, programming language and API designers, tool developers, and educators alike.

Notes

Support for this project was provided by PSC-CUNY Award \#61793-00 49, jointly funded by The Professional Staff Congress and The City University of New York. This material is based upon work supported by the National Science Foundation under Grant Nos. CCF 1845893, CNS 1842456, and CCF 1822965.

Files

bugs.csv

Files (1.9 MB)

Name Size Download all
md5:7a1e63abc043d7da57a615e06ccd95a0
22.7 kB Preview Download
md5:a6f83b25d4e43d865af79349451d2f7f
176.7 kB Preview Download
md5:c397365105c664716342e6d9e74d0bb4
166.2 kB Preview Download
md5:5ed5207c998e10a6c8f1d3a2bc9e0537
144.6 kB Preview Download
md5:156ad53da87524acd24dcf1444e78bfc
813 Bytes Preview Download
md5:17b641e525ff86a1c96d2f4d6063f991
11.0 kB Preview Download
md5:3b0c56cf319476e5e3931826b303cb1d
1.3 MB Preview Download
md5:64b8b9830a1b5f7209eec7e9c2993fa9
33.5 kB Preview Download
md5:e93bbe5bf8e7867d5b991a70162ff8ad
664 Bytes Preview Download
md5:4a76205604adcbbaf32c6b0d2f26ecb5
1.0 kB Preview Download