
greatly, but they are commonly misused, especially by beginner
programmers, who try to use them as a substitute for understand-
ing the code.
■
Specially constructed libraries that reimplement standard libraries
but with extra safeguards, to detect and prevent errors.
■
Tools such as profilers, which describe the pre- and postconditions
(discussed in Section 9.6) and coverage tools that are primarily
used for other purposes but can help in testing.
9.6 Assertions and Defensive Programming
A very useful technique is the use of assertions, which is related to the more
formal concepts of preconditions and postconditions. A precondition is a
condition that y ...