Scan Test Diagnosis of Defects in Semiconductor Devices