Software Coding Guidelines
Master safe coding practices for automotive software development including MISRA C, MISRA C++, AUTOSAR C++14, and CERT C, with practical guidance on rule selection, static analysis integration, and deviation management.
- Chapters
- 15
- Chapters
- C & C++
- MISRA
- C & C++
- Rules Covered
- 400+
- Rules Covered
- Rule Mapping
- ASIL
- Rule Mapping
- 01Overview & Purpose
- 02MISRA C 2012
- 03MISRA C++ 2008
- 04AUTOSAR C++14
- 05CERT C
Why it pays for itself
Tailor a defensible rule set
Build a project-specific rule set from MISRA C, MISRA C++, AUTOSAR C++14, and CERT C - selected by language version, target platform, ASIL, and team capability, with tailoring documented.
Make static analysis work for you
Configure tools like Polyspace, LDRA, and PC-lint for guideline enforcement, manage false positives instead of drowning in them, and wire automated compliance gates into the CI pipeline.
Manage deviations compliantly
Not every violation can be fixed. Run a formal deviation process with safety impact assessment, alternative measures, and records that survive an ISO 26262 assessment.
What you’ll be able to do
Apply MISRA C and MISRA C++
Navigate the complete MISRA C:2012 and MISRA C++:2008 rule sets, understand rule rationale, and apply them correctly in embedded automotive software development.
Select & Tailor Rule Sets
Build project-specific coding rule sets tailored to language version, target platform, ASIL, and team capability with proper tailoring documentation.
Configure Static Analysis Tools
Set up and tune static analysis tools for guideline enforcement with effective false positive management and CI/CD pipeline integration.
Manage Deviations Compliantly
Implement a formal deviation management process with safety impact assessment, alternative measures, and assessment-ready deviation records.
Prevent Critical Defect Classes
Apply guideline rules specifically targeting memory safety, numeric errors, timing issues, and concurrency hazards in safety-critical software.
Generate Compliance Evidence
Produce complete coding guideline compliance evidence packages suitable for ISO 26262 safety assessment including trend data and deviation records.
Chapter by chapter
- 01
Overview & Purpose
Understand why coding guidelines are required by ISO 26262, how they relate to software safety requirements, and the regulatory landscape including IEC 62443 and SOTIF implications for safe coding practices.
- ISO 26262 requirement
- Regulatory landscape
- Safety relationship
- 02
MISRA C 2012
Master the MISRA C:2012 rule set with all 143 rules and 16 directives. Understand mandatory, required, and advisory classifications, the rationale behind high-impact rules, and how to apply them in embedded C development.
- 143 rules & 16 directives
- Rule classifications
- High-impact rules
- 03
MISRA C++ 2008
Navigate MISRA C++:2008 with its 228 rules for safety-critical C++ development. Understand C++ language features to avoid, OOP safety implications, and practical compliance strategies for embedded systems.
- 228 rules coverage
- C++ features to avoid
- OOP safety implications
- 04
AUTOSAR C++14
Explore the AUTOSAR C++14 coding guidelines as the modern successor to MISRA C++ for AUTOSAR-based development. Covers new C++14 feature guidance, overlap with MISRA C++:2008, and adoption strategies.
- C++14 feature guidance
- MISRA overlap analysis
- Adoption strategy
- 05
CERT C
Apply CERT C Coding Standard rules focusing on security-oriented safe coding. Understand how CERT C complements MISRA C, its categorization by severity and likelihood, and which rules are most relevant for functional safety.
- CERT C overview
- MISRA C complement
- Safety-relevant rules
- 06
Rule Selection & Tailoring
Build a project-specific coding rule set by selecting and tailoring guidelines for language version, target platform, ASIL, and team capability. Learn the rule selection process and how to document tailoring decisions.
- Rule set construction
- ASIL-based selection
- Tailoring documentation
- 07
Static Analysis Tools
Evaluate and configure static analysis tools including LDRA, Polyspace, PC-lint, Coverity, and SonarQube for coding guideline enforcement. Understand false positive management, tool qualification, and output interpretation.
- Tool comparison
- Configuration guidance
- False positive management
- 08
Deviation Management
Implement a compliant deviation management process for coding guideline violations. Learn deviation documentation requirements, safety impact assessment, alternative measures, and deviation record management per ISO 26262.
- Deviation process
- Safety impact assessment
- Record management
- 09
Memory Safety
Apply coding guidelines specifically targeting memory safety hazards including buffer overflows, null pointer dereferences, use-after-free, and stack overflow. Understand static and dynamic enforcement strategies.
- Buffer overflow prevention
- Pointer safety
- Stack management
- 10
Timing & WCET
Write code compatible with Worst Case Execution Time analysis. Understand which C/C++ constructs make WCET analysis infeasible, timing-safe coding patterns, and the relationship between coding guidelines and timing verification.
- WCET-hostile constructs
- Timing-safe patterns
- WCET tool integration
- 11
Numeric Safety
Prevent numeric safety hazards including integer overflow, division by zero, floating-point precision issues, and type conversion errors. Apply MISRA and CERT rules targeting numeric computation safety.
- Integer overflow prevention
- Float precision handling
- Type conversion safety
- 12
Concurrency
Write safe concurrent code for multi-core and multi-tasking embedded systems. Cover race condition prevention, mutex usage patterns, interrupt safety, atomic operations, and MISRA rules for concurrent code.
- Race condition prevention
- Mutex safety patterns
- Atomic operations
- 13
CI/CD Integration
Integrate coding guideline enforcement into continuous integration pipelines. Configure automated static analysis gates, manage baseline suppressions, generate compliance reports, and track rule violation trends over time.
- CI pipeline integration
- Automated gates
- Compliance reporting
- 14
Compliance Workflow
Implement an end-to-end coding guideline compliance workflow from initial rule set definition through ongoing enforcement to final compliance evidence generation for safety assessment.
- End-to-end workflow
- Evidence generation
- Assessment readiness
- 15
Model-Based Development
Apply coding guidelines in model-based development environments using Simulink and TargetLink code generation. Understand generated code compliance, model coding standards (MAAB), and tool-specific compliance verification.
- Generated code compliance
- MAAB guidelines
- Tool-specific verification
Not just text: the visual toolkit
Rule Classification Browser
Interactive browser for MISRA C:2012, MISRA C++:2008, and AUTOSAR C++14 rules with filtering by classification, category, and ASIL applicability with side-by-side rule comparison.
Violation Category Heatmap
Visual heatmap of common coding guideline violation categories by frequency, safety impact, and ASIL, based on industry data from static analysis tool surveys.
Deviation Request Template
Interactive deviation request form with guided safety impact assessment, alternative measure documentation, and automatic review checklist generation.
Static Analysis Tool Comparison
Side-by-side comparison of major static analysis tools across dimensions of rule coverage, false positive rate, ASIL qualification support, and CI/CD integration capability.
Rule Set Tailoring Wizard
Step-by-step wizard for constructing a project rule set by selecting base standard, applying ASIL-based recommendations, and documenting tailoring decisions in a compliant format.
Compliance Trend Dashboard
Simulated compliance dashboard showing violation count trends, deviation status, coverage by rule category, and project-level compliance percentage over sprint iterations.
Coding Guideline Implementation for ASIL-C Engine Control
Real-world implementation of MISRA C:2012 compliance for a 45,000-line engine control unit codebase, covering tool selection, baseline establishment, and systematic compliance improvement.
- Initial static analysis scan revealing 2,400 violations across 8 MISRA categories
- ASIL-driven rule prioritization and team training rollout
- Deviation process implementation for 47 justified mandatory rule violations
- CI gate configuration achieving zero new mandatory violations per merge
- Compliance dashboard setup with trend tracking over 6-month remediation
- Final compliance evidence package for safety assessment submission
Unlock 5 more compliance phases
Who this guide is for
- Embedded C and C++ developers meeting MISRA compliance for the first time
- Software leads defining coding standards and CI quality gates for an ASIL project
- Tool owners configuring and tuning static analysis for guideline enforcement
- Teams assembling coding-compliance evidence for a safety assessment
Frequently Asked Questions
Common questions about Software Coding Guidelines
Start the course today
A free account unlocks one full concept guide, 3 work product templates, 1 guided process, the Markov simulator, and 5 practice exams per month. The Pro and Expert plans unlock more of the 77-guide library. No credit card required.