Fray: An Efficient General-Purpose Concurrency Testing Platform for the JVM

📅 2025-01-22
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing concurrent testing tools struggle to simultaneously achieve high bug-detection efficiency, reliable reproducibility, and developer-friendliness. This paper introduces a JVM-based, modification-free, one-click concurrency testing framework tailored for data-race-free programs. It precisely models all feasible executions by orchestrating thread interleavings—without replacing primitives—while introducing the novel “shadow-lock” mechanism to enable efficient, controllable scheduling with zero code intrusion, thereby breaking the traditional trade-off among expressiveness, applicability, and performance. The framework integrates bytecode instrumentation, runtime monitoring, partial-order sampling (POS), randomized search, and semantic-aware lock-behavior encoding. Evaluated on 53 benchmarks with known concurrency bugs, it detects 70% more bugs than JPF and 77% more than RR’s chaos mode. In large-scale real-world testing across Kafka, Lucene, and Guava—comprising 2,655 test cases—it successfully identifies 18 reproducible, production-grade concurrency defects.

Technology Category

Application Category

📝 Abstract
Concurrency bugs are hard to discover and reproduce. Prior work has developed sophisticated algorithms to search for concurrency bugs, such as partial order sampling (POS); however, fundamental limitations with existing platforms for concurrency control hinder effective testing of real-world software. We observe that the design space for concurrency control on managed code involves complex trade-offs between expressibility, applicability, and maintainability on the one hand, and bug-finding efficiency on the other hand. This paper presents Fray, a platform for performing push-button concurrency testing of data-race-free JVM programs. The key insight behind Fray is that effective controlled concurrency testing requires orchestrating thread interleavings without replacing existing concurrency primitives, while encoding their semantics for faithfully expressing the set of all possible program behaviors. Fray incorporates a novel concurrency control mechanism called shadow locking, designed to make controlled concurrency testing practical and efficient for JVM programs. In an empirical evaluation on 53 benchmark programs with known bugs (SCTBench and JaConTeBe), Fray with random search finds 70% more bugs than JPF and 77% more bugs than RR's chaos mode. We also demonstrate Fray's push-button applicability on 2,655 tests from Apache Kafka, Lucene, and Google Guava. In these mature projects, Fray successfully discovered 18 real-world concurrency bugs that can cause 363 tests to fail reproducibly.
Problem

Research questions and friction points this paper is trying to address.

Concurrency Control
Software Testing
Code Maintainability
Innovation

Methods, ideas, or system contributions that make the work stand out.

Concurrent Testing
JVM Platform
Error Detection Efficiency
🔎 Similar Papers
No similar papers found.
A
Ao Li
PASTA Lab, Carnegie Mellon University, Pittsburgh, PA, USA
B
Byeongjee Kang
PASTA Lab, Carnegie Mellon University, Pittsburgh, PA, USA
Vasudev Vikram
Vasudev Vikram
Carnegie Mellon Unviersity
Software Engineering
I
Isabella Laybourn
PASTA Lab, Carnegie Mellon University, Pittsburgh, PA, USA
S
Samvid Dharanikota
PASTA Lab, Carnegie Mellon University, Pittsburgh, PA, USA
S
Shrey Tiwari
PASTA Lab, Carnegie Mellon University, Pittsburgh, PA, USA
Rohan Padhye
Rohan Padhye
Carnegie Mellon University
Software EngineeringSoftware TestingProgram Analysis