Software Fault Detection and Correction: Modeling and Applications