Test Generation and Resynthesis Procedures for Test and Diagnosis Quality