Threshold-Value Simulation and Test Generation