Applying Machine Learning to Testing and Diagnosis of Integrated Systems