Featured Webinar: AI-Enhanced API Testing: A No-Code Approach to Testing | Watch Now
MISRA C 2023
MISRA C is a set of coding guidelines for the C programming language. The focus of the standard is increasing the safety of software by pre-emptively preventing programmers from making coding mistakes that can lead to runtime failures (and possible safety concerns) by avoiding known problem constructs in the C language.
Over the years, many developers of embedded systems were (and still are) complaining that MISRA C was too stringent of a standard and that the cost of writing fully compliant code was difficult to justify. Realistically, given that MISRA C is applied in safety-critical software, the value of applying the standard to a project depends on factors such as:
- Risk of a system malfunction because of a software failure
- Cost of a system failure to the business
- Development tools and target platform
- Level of developer’s expertise
Programmers must find a practical middle ground that satisfies the spirit of the standard and still claim MISRA compliance without wasting effort on non-value-added activities.
When first introducing MISRA C into a project, commonly where code already exists, the key document is the guideline re-categorization plan. This document captures all directives, rules, and identifies which categories have been re-categorized. However, it’s important to have the same rational categorization for newly developed code as well. For example, the following diagram shows part of a re-categorization plan.
The requirement to document deviations is only necessary for all required rules. Any violations in adopted code should be reviewed. Deviations need to clearly state that violations do not compromise safety and security. Regardless of recategorization, if there is a finding that compromises the safety or security of the system, the issue must be fixed. Also, modifications to the existing code may introduce other issues not clearly seen by the developer.
Elevate your software testing with Parasoft solutions.
Explore the Chapters
- Introduction »
- 1. Overview »
- 2. Static Analysis »
- 3. MISRA »
- 4. AUTOSAR C++ 14 »
- 5. SEI/CERT »
- 6. CWE »
- 7. Unit Testing »
- 8. Regression Testing »
- 9. Software Integration Testing »
- 10. Software System Testing »
- 11. Structural Code Coverage »
- 12. Requirements Traceability Matrix »
- 13. Tool Qualification »
- 14. Reporting & Analytics »