Optimizing IC Testing for Diagnosability, Effectiveness and Efficiency