Various embodiments relate to a method of testing a plurality of devices of the same type wherein each of the plurality of devices of the same type include a built-in self-test device, including: randomly generating, by a processor, stimulus parameters; applying, by the built-in self-test devices, the generated stimulus parameters N times to the plurality of devices of the same type; measuring, by the plurality of devices of the same type, a response of the plurality of devices of the same type to the generated stimulus parameters to produce M×N response outputs, where M is a number of the plurality of devices of the same type; calculating, by the processor, a defect likelihood for a
test set of the plurality of identical devices based upon a mean of a reference set of the plurality of identical devices response outputs, a mean of the
test set response outputs, a standard deviation of reference set response outputs, and a standard deviation of the
test set response outputs; determining, by the processor, that the defect likelihood for the test set is greater than a first threshold value; applying, by the processor, an initial step of a directed
random search algorithm to update stimulus parameters in response to determining that the defect likelihood is greater than the first threshold; applying, by the built-in self-test devices, the updated stimulus parameters N times to the plurality of devices of the same type; measuring, by the plurality of devices of the same type, a response of the plurality of devices of the same type to the updated stimulus parameters to produce M×N updated response outputs; calculating, by the processor, a defect likelihood for the test set based upon a mean of the reference set updated response outputs, a mean of the test set updated response outputs, a standard deviation of reference set updated response outputs, and a standard deviation of the test set updated response outputs; and determining, by the processor, that the defect likelihood for the test set is greater than a second threshold, wherein the second threshold is greater than the first threshold.