Skip to Main Content
A monitor is a commonly used synchronization construct in multithreaded programs. Ensuring the correctness of each monitor in a multithreaded program is a critical step towards ensuring the correctness of the entire program. A monitor's correctness can be checked by executing two or more test threads that call the monitor's methods. Reach ability testing can be used to automatically exercise every possible sequence in which the test threads can enter the monitor. Reach ability testing is a stateless testing technique, which allows it to avoid the high storage cost associated with saving states in memory. However, stateless reach ability testing allows large portions of a program's state space to be visited multiple times, since it is not possible to recognize states that have been visited before. This inefficiency can create a “sequence explosion” problem that causes reach ability testing to take too much time. In this paper, we show how to store and recognize visited states when reach ability testing is applied to a single monitor and its test threads. We also show how to use state pruning to avoid storing all of the visited states at once. The results of an empirical study show that adding states to reach ability testing significantly reduces execution time without significantly increasing storage costs.
Date of Conference: 3-4 Nov. 2010