A race-detection and flipping algorithm for automated testing of multi-threaded programs

  • Authors:
  • Koushik Sen;Gul Agha

  • Affiliations:
  • University of California Berkeley;University of Illinois at Urbana-Champaign

  • Venue:
  • HVC'06 Proceedings of the 2nd international Haifa verification conference on Hardware and software, verification and testing
  • Year:
  • 2006

Quantified Score

Hi-index 0.02

Visualization

Abstract

Testing concurrent programs that accept data inputs is notoriously hard because, besides the large number of possible data inputs, nondeterminism results in an exponentially large number of interleavings of concurrent events. In order to efficiently test shared-memory multithreaded programs, we develop an algorithm based on race-detection and flipping and illustrate how it can be combined with concolic execution (a simultaneous symbolic and concrete execution method) to test multi-threaded programs with data inputs. The goal of our algorithm is to minimize redundant executions while ensuring that all reachable statements in a program are executed. To achieve this, our algorithm explores all distinct causal structures of a multi-threaded program (i.e., the partial order among events generated during an execution). Because our algorithm is based on race-detection, it enables us to report potential data races and deadlocks. We have implemented our algorithm in a tool called jCUTE. We describe the results of applying jCUTE to real-world multi-threaded Java applications and libraries. In particular, we discovered several undocumented potential concurrency-related bugs in the widely used Java collection framework distributed with the Sun Microsystems' JDK 1.4.