Defensive database programming

Alexander kuznetsov of has made a summary of previous posts about defensive database programming,defensive programming is an approach that is designed to ensure high quality of software by eliminating existing bugs and avoiding potential ones. The goal of defensive programming to make sure that software robustly and gracefully handles cases of unintended use. Programming defensively includes the following techniques:

  • Explicitly list the assumptions that you made during development
  • Whenever feasible, remove assumptions that are not essential
  • Ensure that the essential assumptions always hold
  • Use all your imagination to come up with cases of unintended use, trying to break your module. Incorporate these cases into your testing suite.
  • Lay out your code in short, fully testable, and fully tested modules
  • Reuse your code whenever feasible

Read the entire post here: