AeroCoder
Open the tools

DO-178C HANDBOOK · CONTENTS

DO-178C HANDBOOK

/

Tools & Other Supplements

Formal Methods (DO-333)

Proof and model checking as verification evidence, and what they can replace.

Desk summary

  • 01In DO-333, a formal method = formal model + formal analysis. Both halves are needed: a precise mathematical notation and a sound analysis of it.
  • 02Three families of formal analysis: deductive proof (theorem proving), model checking and abstract interpretation.
  • 03An analysis only counts as formal if it is sound: it never says a property holds when it does not. False alarms and “don’t know” are acceptable; false “proven” is not.
  • 04Formal analysis can replace some reviews, analyses and tests — including parts of requirements, design and code verification — but never all testing on the target.
  • 05The four structural coverage objectives can be met by a set of formal-analysis activities instead, and new objectives cover property preservation from source to object code and the soundness of the method itself.

Intuition

Think of it like stress analysis instead of crash tests

A structures engineer does not prove a wing spar by bending a thousand samples; they calculate it for every load case in the envelope, then do a few confirming tests. Testing software is like the bending samples: you only learn about the inputs you tried. Formal analysis is the calculation: it reasons about all inputs at once, within the limits of the model. Just as the wing still gets a static test, formal methods still need tests on the real hardware — because the calculation is only as good as the model of the compiler and processor.

Formal models and notations

A formal notation has precisely, mathematically defined syntax and semantics, so a statement in it can mean exactly one thing. A formal model is an abstraction of some aspect of the system written in such a notation: a set of temporal-logic properties, a state machine with defined semantics, a contract-annotated program, or the source code itself when the language semantics are formally defined for the analysis tool. A model typically captures only some properties; DO-333 asks you to state the limits of each model so that everything outside them is verified conventionally.

Note

Formal model without formal analysis

If you only use a formal notation to write requirements or design but do not claim credit from formal analysis, DO-333 is not needed; DO-178C (and DO-331 if it is a model) covers it. DO-333 matters when you want analysis results to replace reviews or tests.

Pitfall

You cannot prove compliance against prose

Formal analysis can only show compliance between two formal artefacts. To prove the code meets a requirement, the requirement must first be formalised — and that formalisation is itself a step that must be verified (a DO-333 activity: correctness of requirements formalisation). A perfectly proven property that mis-states the English requirement gives false confidence.

Three kinds of formal analysis

Formal analysis techniques recognised by DO-333

TechniqueHow it worksGood atLimits
Deductive methods (theorem proving)Build a mathematical proof that the model satisfies each property, usually with an interactive or automated proverDeep functional properties, unbounded data, algorithm correctness (e.g. a voter or filter)Labour-intensive; needs skilled staff; proof effort grows with design churn
Model checkingExhaustively explore the reachable states of a model to check a property, producing a counterexample if it failsMode logic, state machines, protocols, “never/always” safety propertiesState-space explosion; often needs bounded data or abstraction
Abstract interpretationCompute a conservative over-approximation of every possible run of the programAbsence of run-time errors (overflow, divide by zero, out-of-bounds, uninitialised data), stack use, timing boundsImprecision gives “orange” unproven checks that need manual justification

Worked example

Abstract interpretation on generated flight control code

On the model-based helicopter reference project, an abstract-interpretation code prover was run on the generated flight control computer code. It reported 694 run-time checks, all green (proven), with zero red (proven error), zero grey (unreachable) and zero orange (unproven). That result can support DO-333 credit for parts of source-code verification such as accuracy and consistency — provided the prover is qualified for that credit, its configuration and assumptions are reviewed, and target testing still runs.

Soundness and assumptions

Soundness is the line between “formal” and “clever bug-finding”. A sound analysis never reports a property as satisfied when it is not. It may raise false alarms, and it may say “don’t know” — that just means more verification is needed elsewhere. Many popular static analysers are deliberately unsound to reduce noise; they are useful, but their silence is not evidence, and they cannot be used for DO-333 credit.

  • —Every analysis rests on assumptions: input ranges, compiler behaviour, initial state, the absence of concurrency outside the model. DO-333 requires those assumptions to be identified and verified, otherwise coverage of the requirement is incomplete.
  • —The analysis tool almost always needs qualifying (see Tool Qualification); a tool whose proof replaces review and also justifies removing design protection is Criterion 2.
  • —DO-333 adds an objective that the formal method is correctly defined, justified and appropriate — the notation, the analysis, and its fit to the property must be argued in the plans.

What credit is possible

DO-333 leaves planning, configuration management, QA and liaison unchanged. The big changes are in verification. Formal analysis may satisfy review and analysis objectives for HLRs, LLRs, architecture and source code — compliance, accuracy and consistency, compatibility with the target, verifiability, conformance to standards, traceability and algorithm accuracy. For executable object code (Table FM.A-6) the objectives are the same as DO-178C: testing on the target is still required, at least to confirm hardware/software integration and to confirm the understanding of how source maps to object code.

How DO-333 reshapes the verification-of-verification table (A-7 → FM.A-7)

DO-178C Table A-7DO-333 Table FM.A-7
Test procedures correct; results correctFormal analysis cases and procedures correct; results correct and discrepancies explained
HLR and LLR test coverage achievedCoverage of HLRs and LLRs by formal analysis achieved
Statement, decision, MC/DC and data/control coupling coverage (four objectives)One objective: verification coverage of software structure, met by the activities below
Additional code not traceable to source (level A)Property preservation between source and object code verified
—Formal method correctly defined, justified and appropriate

Replacing structural coverage with formal activities

01

Complete coverage of each requirement

Every assumption made during the analysis is verified, so each requirement is fully covered, not just under convenient conditions.

02

Completeness of the requirement set

For formally modelled requirements, show that outputs are specified for every input condition and vice versa. If completeness cannot be shown, fall back to structural coverage.

03

No unintended data flow

Show that the code’s input/output dependencies are exactly those the requirements call for; resolve any extra dependency by adding a requirement or removing code.

04

Detect extraneous and deactivated code

Same intent as DO-178C: find dead, extraneous and deactivated code. Coordinate closely with the authority; unintended control flow also needs attention.

Model-based development

Formal methods on models

Model-based programs are the main route by which formal methods reach avionics. Property proving on a design model (for example, “the autopilot can never be engaged with an air data fault active”) is model checking on a formal model, provided the modelling language’s semantics are defined for the tool. Design error detection — proving the absence of overflow, division by zero and dead logic in a model — is a form of abstract interpretation or bounded model checking. Test generation from models uses the same engines to find inputs that cover objectives. On the code side, abstract-interpretation provers check the generated code. Combine DO-331 and DO-333 in the plans: say which objectives come from the model (DO-331) and which from formal analysis (DO-333).

Practitioner tip

Start where the payoff is

Formal methods are not all-or-nothing. The best return comes from small, complex, error-prone parts: redundancy voters, mode logic, partitioning kernels, numerical robustness of generated code. Keep conventional verification elsewhere and make the boundary explicit in the plans.

What the auditor looks for

What the reviewer will ask

Is the notation formal — where are its semantics defined? Is the analysis sound, and how do you know (tool qualification data)? How were requirements formalised and how was that checked? Which assumptions does each proof depend on and where are they verified? Which objectives are you claiming, and what testing remains on the target? How is source-to-object property preservation argued?

Self-check

A static analyser returns no warnings for a module, but its documentation says it uses heuristics and may miss defects to reduce noise. Can this result take DO-333 credit for absence of run-time errors?

Sources & further reading

  • DO-333, Formal Methods Supplement to DO-178C and DO-278A (2011) — FM.1.6, FM.6, Tables FM.A-6 and FM.A-7
  • Rierson, Developing Safety-Critical Software (2013), ch. 16
  • DO-248C, Supporting Information for DO-178C and DO-278A
  • NASA Langley formal methods program overview (Holloway et al., 2002)
  • Model-based DO-178C/DO-331 reference project: FCC Code Prover report and design error detection report

← Previous

Object-Oriented Technology (DO-332)

Tools & Other Supplements

Next →

Dead, Extraneous & Deactivated Code

Special Topics

On this page

Formal models and notationsThree kinds of formal analysisSoundness and assumptionsWhat credit is possible