AeroCoder
Open the tools

DO-178C HANDBOOK · CONTENTS

DO-178C HANDBOOK

/

Model-Based Development (DO-331)

MBD in Plain Terms

Why aerospace moved to models, what a model really is to an authority, and the traps.

Desk summary

  • 01In model-based development (MBD) a diagram — a dataflow model, a state machine — is not a picture of the software: it is a software life cycle artifact, usually the low-level requirements and architecture, and often the direct input to a code generator.
  • 02To a certification authority a model is just requirements or design written in a precise graphical language. Every DO-178C question still applies: is it correct, complete, verifiable, traceable, conformant to a standard, and did testing of the real executable show it does only what it should?
  • 03MBD pays off by moving error discovery earlier (simulation on the desk instead of failures on the rig) and by replacing hand coding with generation — the classic V becomes a ‘Y’.
  • 04The price: you need requirements above the model, a Software Model Standard, model reviews, model coverage, and a credible story for how generated code is shown to match the model. DO-331 is the supplement that spells this out.
  • 05Simulation is powerful evidence about the model; it is not a substitute for testing the Executable Object Code on the target.

Intuition

Think of it like an architect’s CAD model

An architect’s 3D model is precise enough to compute loads and generate cutting lists — that is what makes it valuable. But the building inspector still wants to know which client brief it was drawn from, whether it follows the building code, and still inspects the poured concrete. A flight-control model is the same: precise enough to simulate and to generate C from, which is exactly why it must be held to requirement- and design-level discipline — and why the real airborne binary is still tested.

Why aerospace moved to models

Control engineers have always thought in block diagrams: a pitch-axis control law is a gain schedule, a few filters, a rate limiter, an integrator with anti-windup and a surface command limiter. For decades that diagram was redrawn as a textual specification, then re-expressed as low-level requirements, then hand-written in C — three translations, each a chance to lose a sign, a unit or a saturation. Model-based development removes translations: the engineer builds an executable dataflow or state-machine model, simulates it against a plant model until the behaviour is right, and generates the source code from it.

Large programs adopted this early — fly-by-wire flight controls, autopilots, flight warning, fuel and braking logic have all been developed with synchronous dataflow tools (Rierson cites the Airbus A380 as an extensive user). The motivation was not fashion: a model that can be executed lets a team find requirement and design errors in the afternoon they are made, long before integration testing on the iron bird.

  • —Earlier verification. Simulation of the model against requirements-based cases exposes wrong behaviour before any code exists. Since verification is typically the larger share of a DO-178C budget, finding errors earlier is where the savings come from.
  • —Fewer translations. One precise artifact instead of three loosely aligned ones (textual LLR, design description, hand code) means fewer inconsistencies when requirements change.
  • —A shared language. Systems, controls and software engineers can all read the same diagram; customers can review behaviour by watching it run.
  • —Automation. Code generation, standards checking, test generation, model coverage and formal property proving all operate on the same machine-readable artifact.

What a model is — to an authority

DO-331 defines a model, in essence, as an abstract representation of some set of aspects of a system, used for analysis, verification, simulation, code generation or any mix of these — and insists that it be unambiguous whatever its level of abstraction. A diagram whose meaning is open to interpretation is, by that definition, not a model at all. The represented aspects may be the whole system or only part of it.

Intuition

The litmus test for ‘is this a model?’

Hand the diagram to two competent engineers and ask them to predict the output for the same input sequence. If they can disagree — because execution order, data types, initial values or the meaning of a block are not pinned down — you have an illustration, not a model. Modeling languages with defined semantics (synchronous dataflow, statecharts with defined execution order) and a Software Model Standard that removes the remaining freedom are what turn a drawing into a model.

Once a diagram qualifies as a model, the authority asks one question before any other: what life cycle data does it represent? A model may represent system requirements, software high-level requirements (HLR), or software design (low-level requirements plus architecture). DO-331 sorts software models into two kinds — the specification model (HLR-level, says what) and the design model (LLR and architecture, says how) — and the whole verification strategy follows from that classification. See Specification vs Design Models.

The V becomes a Y

In the traditional V life cycle, the left leg descends through system requirements, software HLR, LLR and hand code; the right leg climbs back through unit, integration and system testing. In MBD the bottom of the V changes shape: the design model is developed and verified by simulation, the code is generated, and the right leg is entered much sooner. Drawn out, the left leg merges into a single model-centred stem — the ‘Y’.

Note

What the savings figures really mean

Published estimates (quoted by Rierson from a 2004 FAA tools forum) suggested roughly 20% life-cycle savings with an unqualified code generator and up to about 50% with a qualified one. Treat these as an upper bound reached by mature teams with stable tools and good standards; first projects often spend the savings on building the modeling standard, libraries and checking infrastructure.

Where a model can enter the life cycle

A model can appear at the system level (a systems team’s control law model), at the software requirements level, or at the software design level — and there may be several layers of models. DO-331 shows five common arrangements in its model usage table; the most widespread in avionics is textual HLR above a design model from which code is generated. Wherever it enters, there must be requirements outside and above the model that say what the model is for. A model can never be its own requirement.

Where models typically sit in a flight-control program

ArtifactTypical ownerWhat it representsWho verifies what
Control law design model (pitch, roll, yaw)Flight controls / softwareDesign model: LLR + architectureSoftware verification against the textual HLR
AHRS triplex voterSoftwareDesign model of a redundancy-management algorithmReviews, simulation, model coverage, then EOC tests
Autopilot mode logic state machineSystems or softwareDesign model (or a specification model if it only states required mode transitions)Simulation of mode sequences, property proving of ‘never two vertical modes engaged’
Plant / aircraft dynamics modelFlight sciencesNot airborne software — a test environment elementValidated as a simulation tool input, not as DO-178C data

Pitfall

The plant model is not part of the software

Teams sometimes let the aircraft dynamics model, sensor models or test harness sit in the same configuration item as the airborne design model. Keep them separate and explicitly classified: the plant model is part of the simulation environment (and may need justification if simulation results are credited), but it is never software life cycle data of the airborne component.

What does not change

MBD changes the form of requirements and design and adds new evidence types; it does not change the goals. Software must still implement its requirements and nothing else; every requirement must still trace up and down; tests must still be requirements-based and run on the real Executable Object Code; structural coverage of the code at the required level (MC/DC at Level A) is still assessed; configuration management, quality assurance, problem reporting and independence still apply to the model exactly as they would to a document.

Old obligations in new clothes

DO-178C (text and hand code)

▸LLR document reviewed against HLR
▸Design standards (layering, naming, complexity)
▸Code review against LLR and coding standard
▸Unit tests for LLR
▸Structural coverage on code

DO-331 (models and generated code)

▸Design model reviewed and analysed against HLR (and simulated)
▸Software Model Standard (block subset, typing, sample times, settings)
▸Generated code verified against the model, or a qualified generator
▸Simulation cases on the model, reused as tests on target
▸Model coverage analysis and structural coverage on code

The traps, in plain terms

Rierson lists fifteen risks of model-based development. They collapse into a handful of recurring traps that every model-based program meets sooner or later — the MBD Pitfalls & Auditor Findings page goes through them in detail.

  • —The model with no requirement above it. Rierson recounts a 98-page model whose only parent requirement effectively said ‘there shall be a model’. Nothing could be tested against it, so nothing about the model could be shown correct.
  • —Lost ‘collateral validation’. In a hand-coded flow, the coder and the unit tester notice requirement oddities as a side effect. When a tool generates the code, that informal second look disappears unless reviews put it back.
  • —What and how mixed together. Models invite implementation detail. A model that is half requirement and half design is hard to verify as either — hence DO-331’s rule that a model is a specification model or a design model, never both.
  • —Simulation over-claimed. Running a model on a desktop is not running the flight binary on the flight processor. Credit for simulation has to be planned, bounded and agreed.
  • —Tool dependence. If the modeling tool, generator or verifier changes behaviour between versions, every model built with it may need re-verification. Freeze tool versions and settings and record them in the environment configuration index.
  • —The departed modeler. A model without rationale, assumptions and requirements is unmaintainable when its author leaves. Document why, not only what.

What the auditor looks for

First questions a reviewer asks on an MBD project

Which life cycle data does each model represent (specification or design), and where is that written in the PSAC/SDP? What requirements was each model developed from, and are they verifiable on their own? Which modeling standard applies, and how is conformance checked? What credit do you claim for simulation, and is the simulator qualified or its results otherwise confirmed? How do you show the generated code matches the model? Where do the tests run on the target?

Practitioner tip

Start with the boring infrastructure

Before modeling a single control law, lock down: the tool versions, a Software Model Standard with automated checks, the model configuration settings file, an approved block library, the requirement-linking convention and the folder/configuration structure for models, harnesses and results. Teams that do this first spend their first certification review discussing engineering; teams that do not spend it discussing hygiene.

Words you will need

Model

An unambiguous abstract representation of some aspects of a system, used for analysis, verification, simulation and/or code generation.

Specification model

A model that expresses software HLR (functional, performance, interface or safety characteristics) without prescribing internal design.

Design model

A model that prescribes internal data structures, data flow and/or control flow — i.e. LLR and/or architecture. Any model used to generate code is a design model.

Model element

A block, signal, state, transition, parameter or other construct of a modeling language.

Model simulation

Exercising a model’s behaviour with a model simulator; distinct from testing, which executes the real Executable Object Code.

Model coverage analysis

Determining which requirements expressed by a design model were not exercised by verification based on the requirements the model was developed from — a hunt for unintended function.

Requirements from which the model is developed

The higher-level requirements, outside the model, that the model must satisfy and be verified against.

Software Model Standard

The DO-331 standard (data item MB.11.23) that defines the modeling language subset, style, complexity limits, tool constraints and tracing rules.

Self-check

A team presents a Simulink-style diagram of their pitch-axis control law. Two reviewers disagree about whether a rate limiter executes before or after the surface command limiter, because execution order is not defined. What is the best characterisation under DO-331?

Sources & further reading

  • Rierson, Developing Safety-Critical Software (2013), ch. 14 — benefits and risks of model-based development
  • RTCA DO-331, Model-Based Development and Verification Supplement to DO-178C and DO-278A (2011) — glossary, MB.1.6
  • RTCA DO-178C (2011)
  • S. P. Miller, ‘Proving the shalls’, FAA Software & CEH Conference (2005) — as cited by Rierson
  • M. Heimdahl, ‘Safety and software intensive systems: challenges old and new’, FOSE (2007) — collateral validation
  • Model-based DO-178C/DO-331 reference project (helicopter FCC): PSAC, SDP, Software Model Standard

← Previous

Software Life Cycle Data

Configuration, Quality & Liaison

Next →

DO-331: What Changes

Model-Based Development (DO-331)

On this page

Why aerospace moved to modelsWhat a model is — to an authorityThe V becomes a YWhere a model can enter the life cycleWhat does not changeThe traps, in plain termsWords you will need