10/12/2019 1 Keep in mind
Just working is not enough. A good software program is one that is
- Well organized
- Well commented and documented
- Easy to read
- Easy to understand
A good program is not one that just works A good program is not one that just works
Coding standards
Code for safety-critical systems must be certified by a certification authority that certifies that a software product complies with the requirements. Code for safety-critical systems must be certified by a certification authority that certifies that a software product complies with the requirements. Safety-critical means that a failure or a design error could cause a risk to human life. In order to be certified, safety-critical software must comply with given coding standards. For example:
- DO-178
is used for avionic/aerospace applications
- EN 50128
is used for railway systems
- MISRA
is used for automotive systems
Safety Integrity Levels
The safety level associated with a safety-critical code is measured by a Safety Integrity Level (SIL) in terms of probability of failure per hour (PFH) The safety level associated with a safety-critical code is measured by a Safety Integrity Level (SIL) in terms of probability of failure per hour (PFH)
SIL PFH SIL0 > 10-5 SIL1 10-5 - 10-6 SIL2 10-7 - 10-8 SIL3 10-9 - 10-10 SIL4 10-11 - 10-12
Most safety-critical systems require a SIL4 certification for the control software.
Code complexity
“The complexity of a object is a measure of the mental effort required to understand and create that object.” [Myers, 1976] “The complexity of a object is a measure of the mental effort required to understand and create that object.” [Myers, 1976] “Code complexity is a major cause of unreliability in software” [McCabe, 1976]. “Code complexity is a major cause of unreliability in software” [McCabe, 1976]. Programmers writing safety-critical software should contain code complexity.
Complexity metrics
Source code complexity can be measured in several ways. It is important to distinguish between
- the natural complexity of the problem and
- the actual complexity of the solution