8.1 Fault avoidance
Faults in a program are a consequence of programming errors—when programmers make mistakes and introduce incorrect code. If the erroneous code is executed, the program fails in some way. An incorrect output may be produced, the program may not terminate, or the program might crash and not continue execution. For example, a programmer may forget to increment a variable in a loop, with the consequence that the loop never terminates.
Therefore, to improve the reliability of your program, you should program in a way that minimizes the number of faults in the program. You can do this by testing your program to reveal faults and then changing the code to remove these faults. However, if you can, it is better to minimize programming ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access