defensive design
practice of planning for contingencies in the design stage of a project or undertaking, by anticipating all possible ways that things may go wrong and minimizing the negative consequences
defensive programming
form of defensive design intended to ensure the continuing function of a piece of software under unforeseen circumstances