A scalar cost function for analyzing the quality of totally self-checking design methodologies