COMP 2404 Lecture Notes - Lecture 10: Exception Handling, Null Pointer, Fault Detection And Isolation
Document Summary
How we handle errors in the software. Faults in general are bugs, how do we prevent and detect them. If they are there we need to have fault tolerance. Writing software that keeps running even when there are faults present. Types of faults: bad inputs: wrong data type, software bugs : array bounds, segmentation voilations,null pointers . Fault prevention: writing software in a way that minimizes the number of fauls. Follow the rules of good design (encapsulation, data abstraction) Fault detection: discovering faults before the user does. Ability of program to keep running in the presence of faults. How do we tolerate faults? error checking (contracts,assertions) exception handling (alternate flow of control when error state is reached) : Gives a parallel control flow only when there are faults. Exceptional problems that occur during a programs execution. Occur infrequently (does not happen very often)