A method, apparatus, system, and signal-bearing medium that, in an
embodiment, receive elements and a goal for each of the elements. In
various embodiments, the elements may represent commands or parameter
values for a device to be tested. Testcases are generated based on the
elements. If the numbers of testcases for the elements are equally
distant from their goals, then a new testcase is generated based on an
element chosen at random. But, if the numbers of testcases are not
equally distant from their goals, then the new testcase is generated
based on the element whose number of testcases if furthest from its
respective goal. The number of testcases associated with the chosen
element is then incremented, and the process is repeated. In this way,
the generated testcases are based on the numbers of previously generated
testcases, which, in an embodiment, results in more complete coverage of
testcases for the device under test.