DocumentCode
625517
Title
CHECK-THEN-ACT Misuse of Java Concurrent Collections
Author
Yu Lin ; Dig, Danny
Author_Institution
Univ. of Illinois at Urbana-Champaign, Urbana, IL, USA
fYear
2013
fDate
18-22 March 2013
Firstpage
164
Lastpage
173
Abstract
Concurrent collections provide thread-safe, highly-scalable operations, and are widely used in practice. However, programmers can misuse these concurrent collections when composing two operations where a check on the collection (such as non-emptiness) precedes an action (such as removing an entry). 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 implemented a tool, CTADetector, to detect and correct misused CHECK-THEN-ACT idioms. Using CTADetector 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-THEN-ACT idioms are commonly misused in practice, and correcting them is important.
Keywords
Java; cataloguing; concurrency control; program debugging; public domain software; software metrics; CTADetector tool; Java concurrent collections; atomicity violation bug; buggy instances; empirical study; entry removal; misused CHECK-THEN-ACT idiom cataloging; misused CHECK-THEN-ACT idiom correction; misused CHECK-THEN-ACT idiom detection; nonemptiness; open source Java projects; open-source application corpus; qualitative analysis; quantitative analysis; source lines-of-code; thread-safe-highly-scalable operations; Catalogs; Computer bugs; Industries; Java; Libraries; Semantics; Synchronization; Atomicity Violation; Check-then-Act; Empirical Study; Java Concurrent Collection;
fLanguage
English
Publisher
ieee
Conference_Titel
Software Testing, Verification and Validation (ICST), 2013 IEEE Sixth International Conference on
Conference_Location
Luembourg
Print_ISBN
978-1-4673-5961-0
Type
conf
DOI
10.1109/ICST.2013.41
Filename
6569728
Link To Document