1. A method, performed by a computer system, for testing a multi-threaded computer program, the method comprising: receiving a context-switch bound (csb) that specifies a number of preempting context switches; repeatedly executing the computer program in a multi-threading environment from an initial state to reach all possible states of execution of the computer program that are reachable from the initial state with at most csb preempting context switches; for each state that is reachable from the initial state with the number of preempting context switches specified by the csb, storing the state and ceasing the corresponding execution of the computer program; after repeatedly executing the computer program from the initial state to reach all possible states that are reachable from the initial state with at most csb preempting context switches, repeatedly executing the computer program from each stored state to reach all possible states of execution of the computer program that are reachable from each stored state with at most csb preempting context switches; and for any error detected during the repeated execution of the computer program, notifying a user of the error.