1. A method for testing a transactional memory implementation, comprising the steps of automatically: generating a test program which has at least two threads, has at least one transaction, and has at least one shared variable which is concurrently accessed by at least two threads and which is accessed both inside a particular transaction and outside that particular transaction; formulating schedules of the test program which specify different interleavings of read operations and write operations of the test program threads; obtaining a set of legal final state(s) of at least one shared variable by executing schedules of the test program under a locking memory model implementation; producing a set of candidate final state(s) of at least one shared variable by executing schedules of the test program under the transactional memory implementation being tested; and determining whether the set of candidate final states is a subset of the set of legal final states of the shared variable(s).