Variation and Failure Characterization Through Pattern Classification of Test Data From Multiple Test Stages