AeroCoder
Open the tools

DO-178C HANDBOOK · CONTENTS

DO-178C HANDBOOK

/

Model-Based Development (DO-331)

MBD Pitfalls & Auditor Findings

The recurring mistakes on model-based programs and how to avoid them.

Desk summary

  • 01Most MBD findings are not about the tools — they are about what the model is claimed to be and what the evidence is claimed to prove.
  • 02The classic structural mistakes: one model used as both HLRs and LLRs, no real requirements above the model, and derived model logic nobody flagged.
  • 03The classic evidence mistakes: simulation claimed as executable-object-code testing, model coverage claimed as code coverage, generated tests claimed as requirement-based tests.
  • 04The classic configuration mistakes: uncontrolled libraries and data dictionaries, drifting model configuration settings, evidence produced on a different model version than the one baselined.
  • 05Numerics and generator trust round out the list: floating-point and fixed-point behaviour that differs between host and target, and an unqualified code generator with no real code verification.

Intuition

Why MBD fails in new ways

Models make it very easy to do a lot very quickly: one click simulates, one click generates code, one click produces a 300-page report. The danger is that speed is mistaken for assurance. Every one of the pitfalls below is a case of a convenient artefact being presented as evidence for something it does not actually prove.

Pitfalls in what the model is

Pitfall

1. One model as both HLRs and LLRs

A single model is presented as the software requirements and the design, with code generated straight from it. DO-331 forbids a model being both a specification model and a design model: if it prescribes internal data flow, control flow or data structures, it is a design model, and something above it must state the HLRs. Without that layer, nothing independent says what the model should do, so verifying the model against its requirements is circular.

Pitfall

2. No real requirements above the model

The HLRs exist on paper but say little more than “the software shall implement the control law model”, or they are back-written from the model after the fact. Rierson recounts a 98-page model with essentially one requirement above it. Test cases then have nothing to be derived from except the model itself. Write HLRs that state behaviour, ranges, rates, modes, failure handling and performance — independent enough that a different engineer could build a different, equally valid model from them.

Pitfall

3. Untraceable derived model logic

Designers add rate limiters, filters, latches, default branches and saturations to make the model behave in simulation. Each is a design decision that no HLR requested — a derived requirement — and must be identified, justified and given to the safety assessment. The case study shows a typical example: a no-valid-sensor branch in a sensor voter that no requirement specifies.

Pitfall

4. Mixing what and how in a specification model

A model intended as a specification model gradually accumulates implementation detail (specific integrators, discretisation, buffer handling). It has silently become a design model, and the plan, standard and verification approach no longer match. Review specification models explicitly for design content and either remove it or reclassify the model.

Pitfalls in what the evidence proves

Pitfall

5. Simulation claimed as EOC testing

Passing simulations on a desktop are presented as satisfying A-6 (executable object code complies with requirements). The simulator executes the model, not the compiled target code; it does not exercise the compiler, target arithmetic, scheduling, memory or I/O. Simulation can support model-level objectives; A-6 needs tests on the EOC on the target or a representative platform. See Simulation for Verification Credit.

Pitfall

6. Model coverage claimed as code coverage

Model coverage measures decisions and conditions in model blocks; structural coverage per DO-178C measures statements, decisions and MC/DC in the code (and at Level A, any object code not traceable to source). Generated code contains structures that have no one-to-one model equivalent — library utilities, saturation checks, initialisation, optimised expressions. In the case study the same voter had a model complexity of 38 but code complexity of 23. Measure both, and use each for its own purpose. See Model Coverage Analysis.

Pitfall

7. Generated tests counted as requirement-based tests

A test generator creates cases to hit coverage objectives, with expected outputs taken from the model. Running them on the code shows that the code behaves like the model — useful equivalence evidence — but they do not show that the model (or the code) meets the requirements. If the model is wrong, generated tests confirm the error. Use generated tests to find gaps, then analyse each gap.

Pitfall

8. Unreviewed test assertions

Automated test tools turn every assertion into a green tick, so weak assertions go unnoticed. A real example from the case study: some checks compare (output − expected) < Tol without an absolute value, which passes for any output below the expected value. Review test cases, procedures and results as DO-178C A-7 and the DO-331 simulation objectives require — including the assertions themselves.

Pitfall

9. Unqualified generator with no real code verification

The plan says the generator is unqualified and its output will be verified, but in practice the code is never reviewed against the model, MISRA findings are left “unreviewed”, and coverage is measured only on the model. With an unqualified generator, the generated code needs the full A-5 treatment — review or qualified source-to-model inspection, standards checking, accuracy and consistency analysis — plus A-6 testing and A-7 structural coverage on the code.

Pitfall

10. Treating tool warnings as optional

A model-standard check reports a warning (for example a block setting incompatible with the source-to-model inspector), nobody acts, and the code inspection later fails for that model. Decide up front which warnings are gate failures for your credit strategy and record a disposition for every remaining warning.

Pitfalls in configuration control

Pitfall

11. Uncontrolled libraries and data dictionaries

Shared block libraries, bus definitions, enumerations and parameter dictionaries change the behaviour of every model that uses them, yet they are edited informally because they “aren’t models”. Treat each library block as software with requirements, tests and coverage, and put data dictionaries under the same baseline and review as the models. A one-line change to a shared gain or type alias can invalidate every verification result downstream.

Pitfall

12. Model configuration drift

Solver, sample-time, data-type, optimisation and code-generation settings live inside each model and drift as engineers tweak them. Two models with different settings can generate differently behaving code from identical diagrams. Use a shared, locked configuration set from a template, check it automatically on every model, and record it in the design description.

Pitfall

13. Evidence for the wrong version

The model is touched after review (“just a layout change”), regenerated, and old reports are kept. Or reports from an earlier run sit beside newer ones in the same folder. Stamp the model checksum into every report, compare against the SCI, and regenerate evidence when the checksum changes — layout-only changes included unless you can show the checksum is unaffected.

Pitfall

14. Tool versions not frozen

Modelling, generation and verification tools are updated mid-programme without impact analysis. Generated code changes, check behaviour changes, qualification evidence no longer matches the installed version. Freeze versions and patches in the SECI; treat a tool upgrade as a change requiring regression of generation and verification.

Pitfalls in numerics

Pitfall

15. Floating-point behaviour assumed identical on host and target

Simulation runs in double precision on a desktop FPU; the target may use single precision, a different FPU, different compiler optimisations or fused operations. Results differ slightly, and comparisons with tight tolerances fail — or worse, loose tolerances hide real errors. Define tolerances from the requirement, run the requirement-based tests on the target, and state analysis assumptions (static analysers often assume no NaN or infinity values).

Pitfall

16. Fixed-point scaling and overflow

Fixed-point or integer interfaces (such as 16-bit sensor counts) introduce scaling, saturation and wrap-around that do not show up in floating-point simulation. Declare design min/max ranges on interfaces, run range and overflow analysis on the model, and confirm with run-time-error analysis on the code. Treat “undecided” analysis results as open items, not passes.

Pitfall

17. Floating-point equality and division

Equality tests on floating values, unguarded division and log/sqrt of possibly negative inputs are classic modelling-standard violations that generate fragile code. Most high-integrity modelling standards include rules for these; make sure the checks are in the qualified set.

The pitfalls at a glance

Pitfall → symptom → prevention

PitfallSymptom an auditor seesPrevention
Model as both HLR and LLRNo requirements document above the model; tests trace to model blocksClassify each model in the PSAC; write HLRs or a separate specification model
Weak requirements above the modelOne HLR traced to hundreds of model elementsRequirements standard with content rules; review HLRs before modelling
Untraceable derived logicModel elements without links; coverage gaps reached only by generated testsModel review checklist item; derived requirements to safety
Simulation as EOC testingA-6 evidence is a simulation reportPlan target/PIL execution of the same cases
Model coverage as code coverageNo code coverage report; A-7 claimed from model coverageMeasure both; report separately
Generated tests as requirement testsTest cases with no requirement link and model-derived expected resultsAnalyse each generated test; add requirement-based tests
Weak assertionsPassing tests with one-sided or tolerance-free checksReview assertions as part of test review
Unqualified generator, little code verificationNo code review / inspection records; MISRA findings unreviewedFull A-5 on generated code or qualified inspector
Ignored warningsDownstream tool failure on a construct flagged earlierWarnings as gate items with dispositions
Uncontrolled libraries / dictionariesLibrary blocks with no requirements; dictionary changes outside CMTreat as software; baseline with models
Configuration driftDifferent solver/type/optimisation settings between modelsLocked configuration set + automated check
Evidence for wrong versionChecksum mismatch between report and SCI; stale reports in foldersChecksums in every report; clean evidence folders
Tool versions not frozenSECI lists versions different from reportsFreeze and control tool upgrades
Float host/target differencesTarget results differ from simulation; tolerances unjustifiedRequirement-based tolerances; target testing
Fixed-point overflowUndecided or untested overflow on scaled interfacesRanges on interfaces; model and code range analysis

What the auditor looks for

The five questions that expose most of these

What is each model — specification or design — and what is above it? Show me one HLR, its model elements, its code and its target test. Show me a model element with no requirement link and tell me why it exists. Which tests ran on the target, and which only in simulation? Show me that the model checksum in this report matches the SCI.

Practitioner tip

Make the pitfalls impossible, not just forbidden

Encode as much as possible in automation: model templates with locked settings, check configurations that fail the build on unlinked elements, test templates that require a requirement link, report scripts that refuse to run on a dirty model, and evidence folders cleared before each baseline run. Process rules that rely on memory fail under schedule pressure; scripts don’t.

Pre-SOI pitfall sweep

0/12

Self-check

A team reports 100% MC/DC model coverage and asks for credit for the A-7 structural coverage objectives on their generated code. What is the main problem?

Sources & further reading

  • DO-331 §MB.1.6.2 (specification and design models), §MB.6.7, §MB.6.8, §MB.11.23
  • DO-178C §6.4.4 (test coverage analysis), Annex A Tables A-5 to A-7
  • Rierson, Developing Safety-Critical Software (2013), ch. 14 (risks of model-based development)
  • MathWorks DO-178C/DO-331 case study project: model-standard, test, coverage, code-inspection, MISRA and code-proving reports
  • EASA CM-SWCEH-002 (Software Aspects of Certification), section on model-based development

← Previous

Mapping Tools to Objectives

Model-Based Development (DO-331)

Next →

Tool Qualification (DO-330)

Tools & Other Supplements

On this page

Pitfalls in what the model isPitfalls in what the evidence provesPitfalls in configuration controlPitfalls in numericsThe pitfalls at a glance