1. A method comprising: (a) generating a first path from the starting node of a control-flow graph to a goal node of said control-flow graph based on the values of a metric for one or more other nodes of said control-flow graph; (b) generating a second path from said goal node to an ending node of said control-flow graph; and (c) generating, based on the concatenation of said first path and said second path, a first test case for the program from which said control-flow graph is derived.