1. A computer-implemented method for verifying a design, comprising: converting test specifications of the design into a set of constraints defined over variables, such that solutions satisfying the set of constraints define respective valid test cases for verifying the design; defining an objective function over at least some of the variables; repeatedly invoking an optimization process over an input comprising the set of constraints and the objective function, and randomly modifying the input of each invocation so as to cause the optimization process to produce multiple different solutions that satisfy the set of constraints; and generating multiple random test cases for verifying a compliance of the design with the specifications based respectively on the multiple different solutions produced by the optimization process.