1. A method for automatically generating test programs, comprising: receiving a description of a system under test, expressed in terms of variables associated with the system and conditional constraints comprising semantics applied to the variables; receiving a definition of an event to be tested in the system; generating an ECondCSP over the variables responsively to the definition of the event and to the conditional constraints, such that at least some of the semantics of the conditional constraints are preserved in the ECondCSP when one or more of the variables to which the semantics are applied are inactive; and solving the ECondCSP to generate a test case for the system.