AeroCoder
Open the tools

DO-178C HANDBOOK · CONTENTS

DO-178C HANDBOOK

/

Model-Based Development (DO-331)

Model Coverage Analysis

Model coverage vs code coverage, unintended functionality and how they complement each other.

Desk summary

  • 01Model coverage analysis (MB.6.7) finds which parts of a design model were not exercised by verification based on the requirements the model was developed from. Its purpose is to expose unintended function and incomplete requirements-based verification.
  • 02Gaps are resolved like structural coverage gaps: add a missing requirements-based case, fix or add a missing requirement, mark and justify a derived requirement, document deactivated function, or remove unintended function.
  • 03DO-331 does not impose one criterion; its example (Table MB.6-1) asks for coverage of all characteristics of the required functionality, equivalence classes and boundary/singular values, and derived requirements. Tools typically measure block execution, decision, condition, MC/DC, state/transition, lookup-table and saturation coverage.
  • 04Model coverage does not replace structural coverage of the code. DO-331’s FAQs discuss when model coverage can support code coverage claims, under strict conditions; the default is to do both.
  • 05Coverage-closing tests generated automatically from the model structure verify the model against itself — they find gaps but are not requirements-based evidence on their own.

Intuition

Footprints in the snow

Run every requirements-based simulation case, then look at the model as a field after a snowfall: every block, branch and transition your cases touched has footprints. The untouched patches are the interesting part — either your tests missed something the requirements ask for, the requirements forgot to ask for something the model does, or the model does something nobody asked for. Model coverage analysis is the walk across the field looking for clean snow.

What it is and why DO-331 added it

DO-331’s glossary describes model coverage analysis as determining which requirements expressed by the design model were not exercised by verification based on the requirements from which the design model was developed, to support detection of unintended function once requirements coverage has been achieved. The idea is the model-level twin of structural coverage analysis: a design model is the LLR, so measuring how much of it requirements-based verification exercised tells you whether the LLR were fully verified and whether the model contains behaviour the higher-level requirements never asked for.

MB.6.7 is referenced in the activity column of Annex MB.A — supporting design-model compliance with HLR (Table MB.A-4) and test coverage of LLR (Table MB.A-7) — rather than as a new numbered objective. Rierson explains this as a drafting compromise and notes authorities still expect it, or an alternative with equivalent rigour. It applies to design models; specification models are not subject to it.

Model-based development

Why the code coverage analogy is not enough

On a hand-coded project, code structural coverage finds untested LLR and unintended code. With generated code, a gap seen in the C is hard to map back to a requirement and arrives late. Measuring coverage on the model finds the same class of problem at the level where engineers think and where requirements are linked — weeks or months earlier.

What a coverage gap can mean (MB.6.7.2)

DO-331 lists what model coverage analysis helps detect and resolve. Each corresponds to a different fix — so the analysis is not finished when the percentage reaches 100, but when each gap has a recorded disposition.

Gap categories and their resolution

Category (MB.6.7.2)Typical causeResolution
Shortcomings in requirements-based verification cases or proceduresA requirement exists but no case exercised that behaviourAdd or fix the requirements-based case
Inadequacies in the requirements from which the model was developedThe model correctly does something the HLR never stated (e.g. a fallback when all three AHRS are invalid)Update the HLR; then add the case
Derived requirements expressed by the modelDesign decisions not traceable to HLR (filter initialisation, persistence counters)Mark as derived, justify, pass to safety assessment, add cases
Deactivated functionality expressed by the modelBehaviour present for another configuration or variantDocument the deactivation mechanism; verify it cannot be activated inadvertently
Unintended functionality expressed by the modelLogic that serves no requirement — leftover experiment, copy-pasteRemove it (and re-verify)

Worked example

AHRS voter: 97% is where the work starts

In the reference helicopter project, the AHRS voter’s three requirements-based simulation tests passed and reached 100% execution coverage but 97% decision coverage. The remaining decision outcomes were then targeted with a model test-generation tool, which produced inputs satisfying the two outstanding objectives. The engineering question is not ‘can a tool reach them?’ but ‘which requirement do those outcomes implement?’ — if a voter branch handles, say, a validity transition no HLR describes, the HLR is incomplete and must be fixed before the new case counts as requirements-based.

Coverage criteria at model level

Because modeling notations differ widely (dataflow vs state machines, synchronous vs asynchronous, formal vs informal), DO-331 does not prescribe criteria. Its example (Table MB.6-1) frames them in requirement terms — cover all characteristics of the functionality, the equivalence classes and boundary/singular values of numeric data, and all derived requirements — and the applicant defines the actual criteria in the SVP. In practice, model coverage tools provide metrics that map onto those goals, and projects commonly align the model criterion with the code criterion for the software level (MC/DC on model logic for Level A).

Common model coverage metrics (tool-neutral)

MetricApplies toWhat 100% means
Execution / blockAll blocks, conditionally executed subsystemsEvery block or subsystem executed at least once
DecisionSwitches, if/else blocks, logical outputs, chart transitionsEvery decision took every outcome
ConditionInputs of logical operators, transition guardsEvery condition took true and false
MC/DCLogical expressions, transition guardsEach condition shown to independently affect its decision
State / transitionState machinesEvery state entered, every transition taken
Lookup tableGain schedules, interpolation tablesEvery interpolation interval and both extrapolation/clip regions exercised
Saturation / limiterSaturation, rate limiters, dead zonesBelow, within and above the limit each reached
Relational boundaryComparisonsValues exercised at and around the comparison threshold
Signal rangeSignalsObserved min/max recorded and compared with design ranges
Observability-based criteria (some formal synchronous toolsets)Dataflow nodesEach element shown to influence an output, not just be executed

Practitioner tip

Look at saturations and lookup tables first

In control laws, uncovered saturation regions and lookup-table intervals are the most informative gaps. An unexercised upper limit on the elevator command means no case tested full-authority demand; an unexercised extrapolation region of a dynamic-pressure gain schedule means nobody verified behaviour above VMO. These map directly onto robustness requirements.

Model coverage vs code structural coverage

Complementary, not interchangeable

Model coverage (MB.6.7)

▸Measured on the design model during simulation
▸Finds untested LLR and unintended function in the model
▸Expressed in model terms engineers can act on
▸Blind to code the generator adds (initialisation, guards, library calls, rate handling)
▸Blind to compiler and object-code effects

Structural coverage (DO-178C §6.4.4.2)

▸Measured on source/object code during requirements-based tests
▸Statement (C), decision (B), MC/DC (A) on the code
▸Also covers hand-written code and integration
▸Level A: plus source-to-object code traceability analysis
▸Also the basis for data and control coupling coverage

Generated code can contain structure that has no one-to-one counterpart in the model: protective code for division or casts, initialisation functions, loop constructs from vector operations, helper functions from libraries, code for rate transitions. Conversely, one model decision can expand into several code decisions. So 100% model coverage does not automatically mean 100% code coverage, and the reverse also holds. DO-331’s FAQs discuss when model-level coverage can support code-level structural coverage claims; vendors of qualified generator-and-coverage toolchains argue such an implication under defined conditions (same generation options, qualified tools, documented exceptions). Treat that as a specific, pre-agreed argument, not a default.

Pitfall

Skipping code coverage because the model is 100% covered

A frequent finding: the team reached full model coverage and planned no structural coverage on the generated code. Unless the PSAC presents — and the authority accepts — a specific argument that model coverage implies code coverage for this toolchain and configuration, structural coverage of the code (and, at Level A, source-to-object traceability) is still required. See Structural Coverage & MC/DC.

Auto-generated tests and independence

Model analysis tools can generate inputs that reach uncovered objectives in seconds. Used well, this is a powerful diagnostic: it shows the gap is reachable and gives a concrete scenario to reason about. Used for credit without thought, it is circular — a test derived from the model’s structure checks the model against itself, and an error in the model becomes an expected result. Rierson warns that machine-generated tests may miss what human test authors find, and that for higher levels the test generator and the code generator should be independently developed.

Handling a model coverage gap

01

Confirm requirements coverage first

Model coverage is meaningful only after every requirement has its requirements-based cases.

02

Locate the gap

Identify the exact block, decision, condition or transition and the outcome not exercised.

03

Find the requirement

Ask which requirement this behaviour implements. If one exists, the case set is deficient; if none exists, the requirements or the model are.

04

Classify

Missing case, requirement inadequacy, derived requirement, deactivated function, unintended function — or genuinely unreachable (e.g. defensive limits shown unreachable by analysis).

05

Resolve and record

Add a requirements-based case (a generated input can seed it, with an expected result from the requirement, not the model), update requirements, justify or remove, and record the disposition.

06

Re-run and re-measure

Regression-run the full case set and confirm coverage and dispositions on the final baseline.

What the auditor looks for

What a reviewer asks about model coverage

Which criteria did you apply, and where does the SVP justify them? Was coverage measured with requirements-based cases only? Show the gap list and each disposition. Which cases were tool-generated, and how were their expected results derived? How do model coverage and code structural coverage reports reconcile? Was coverage measured on the same model version, with the same configuration, that generated the flight code?

Self-check

Model coverage on a design model is 100% decision coverage using requirements-based simulation cases. Which statement is most accurate?

Sources & further reading

  • RTCA DO-331 (2011) — glossary (model coverage analysis), MB.6.7, MB.6.7.2, Table MB.6-1; Annex Tables MB.A-4 and MB.A-7; FAQ on model vs structural coverage
  • RTCA DO-178C (2011) — §6.4.4.2 structural coverage analysis
  • Rierson, Developing Safety-Critical Software (2013), ch. 14.3 (risks 4, 8, 13) and 14.4 (Difference 5)
  • Ansys, SCADE Suite methodology handbook for DO-178C/DO-331 — model coverage criteria and relation to code coverage
  • Model-based DO-178C/DO-331 reference project: AHRS_voter requirements-based test report (aggregated model coverage), AHRS_voter test generation report, FCC dead-logic report

← Previous

Simulation for Verification Credit

Model-Based Development (DO-331)

Next →

Code Generation & Code Verification

Model-Based Development (DO-331)

On this page

What it is and why DO-331 added itWhat a coverage gap can mean (MB.6.7.2)Coverage criteria at model levelModel coverage vs code structural coverageAuto-generated tests and independence