Defensive Programming Flashcards
What is a Software Crisis?
Difficult to write useful & efficient computer programs in the required time because of rapid increase in computer power and complexity of problems that need to be solved.
What is Spaghetti Code?
Unstructured and difficult to maintain source code.
Defensive Programming
Ensure the continuity of a piece of software in spite of unforeseeable usage of said software.
What are Invariants?
Conditions that do not vary.
Types of Invariants?
Loop invariants
Class invariants
Method invariants
Loop invariant
True at the beginning of each loop
Class Invariants
True before and after each method call
Method Invariants
Pre- and post conditions
What is Structured Programming?
component-level design technique which uses only small set of programming constructs
What are Code Guides
Set of rules to which programmers must adhere