Another key aspect of defensive programming is the use of debugging aids, which can be a powerful ally in quickly detecting errors.
Don't Automatically Apply Production Constraints to the Development Version
A common programmer blind spot is the assumption that limitations of the production software apply to the development version. The production version has to run fast. The development version might be able to run slow. The production version has to be stingy with resources. The development version might be allowed to use resources extravagantly. The production version shouldn't expose dangerous operations to the user. The development version can have extra operations that you can use without a safety net.
For more ...