Files in this item



application/pdf2013-ICST-YuLinETAL.pdf (497kB)
(no description provided)PDF


Title:Check-then-Act Misuse of Java Concurrent Collections
Author(s):Lin, Yu; Dig, Danny
Java concurrent collection
Atomicity violation
Abstract:Concurrent collections provide thread-safe, highly-scalable operations, and are widely used in practice. However, programmers can misuse these concurrent collections by composing one operation that checks a condition (e.g., whether the collection contains an element) with another operation that acts based on this condition (e.g., insert the element into the collection). Unless the whole composition is atomic, the program contains an atomicity violation bug. In this paper we present the first empirical study of CHECK-THEN-ACT idioms of Java concurrent collections in a large corpus of open-source applications. We catalog nine commonly misused check-then-act idioms and show the correct usage. We quantitatively and qualitatively analyze 28 widely-used open source Java projects that use Java concurrency collections – comprising 6.4M lines of code. We classify the commonly used idioms, the ones that are the most error-prone, and the evolution of the programs with respect to misused idioms. We found 282 buggy instances. We reported 155 to the developers, who examined 90 of them. The developers confirmed 60 as new bugs and accepted our patch. This shows that CHECK-THENACT idioms are commonly misused in practice, and correcting them is important.
Issue Date:2012
Genre:Technical Report
Publication Status:published or submitted for publication
Peer Reviewed:not peer reviewed
Date Available in IDEALS:2012-10-19

This item appears in the following Collection(s)

Item Statistics