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)

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s