the_power_of_10_-_rules_for_developing_safety-critical_code

The Power of 10 - Rules for Developing Safety-Critical Code

See:

The Power of 10 Rules were created in 2006 by Gerard J. Holzmann of the NASA/JPL Laboratory for Reliable Software.<ref name=“PowerOf10”>The Power of 10: Rules for Developing Safety-Critical Code</ref> The rules are intended to eliminate certain C coding practices which make code difficult to review or statically analyze. These rules are a complement to the MISRA C guidelines and have been incorporated into the greater set of JPL coding standards.<ref name=“JPL”>JPL C Coding Standard - JPL Laboratory for Reliable Software</ref>

Rules

The ten rules are:<ref name=“PowerOf10”/>

  1. Avoid complex flow constructs, such as goto and recursion.
  2. All loops must have fixed bounds. This prevents runaway code.
  3. Restrict functions to a single printed page.
  4. Use a minimum of two runtime assertions per function.
  5. Restrict the scope of data to the smallest possible.
  6. Check the return value of all non-void functions, or cast to void to indicate the return value is useless.
  7. Use the preprocessor sparingly.
  8. Limit pointer use to a single dereference, and do not use function pointers.
  9. Compile with all possible warnings active; all warnings should then be addressed before release of the software.

Uses

See also

Snippet from Wikipedia: The Power of 10: Rules for Developing Safety-Critical Code

The Power of 10 Rules were created in 2006 by Gerard J. Holzmann of the NASA/JPL Laboratory for Reliable Software. The rules are intended to eliminate certain C coding practices that make code difficult to review or statically analyze. These rules are a complement to the MISRA C guidelines and have been incorporated into the greater set of JPL coding standards.

Categories: Category Programming principles


Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


the_power_of_10_-_rules_for_developing_safety-critical_code.txt · Last modified: 2025/02/01 06:25 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki