if tests are generated randomly this garntees only a certain probability that a device is ok. There is a mathematical approach to generate alpha-tests (to test all possible signal paths), beta-tests (test compensatory paths), OV-tests and so on. The whole algorithms here are rather difficult, they based on directional derivatives from logical functions...