Category Archives: coding rule

Defensive Programming Practices ?

Defensive programming practice는 software의 robustness와 관련이 있다.

  1. Avoidance of input data errors
    • bounds check
    • data type, scaling, loss of precision
    • run time checks
  2. Avoidance of non-determinism
    • banning self-modifying code
    • minimizing memory paging
    • avoiding dynamic binding
    • explicit initialization
  3. Avoidance of complexity
    • maximize cohesion, minimize coupling
    • minimize use of interrupt-driven processing
    • minimize use of multi-tasking, multi tasking
  4. Avoidance of interface errors
    • mininize global variables
  5. Avoidance of logic errors
    • avoid using expression with side effects(such as short circuit expression,,,)



Supporting Information for DO-178C and DO-278A(DO-248C)

Review Guidelines on Software Languages for Use in Nuclear Power Plant Safety Systems – Final Report (NUREG/CR-6463)