Desk summary
- 01DO-332 is the supplement for object-oriented technology and related techniques (OOT&RT). It adds to DO-178C; it never replaces it.
- 02The “related techniques” — overloading, type conversion, exception management, dynamic memory, generics and virtualization — appear in non-OO code too, so DO-332 can apply even to a C or Ada project.
- 03Its central idea is type safety via the Liskov Substitution Principle: any subclass must be usable wherever its parent is expected, so verification of the parent still holds.
- 04Two new verification objectives: verify local type consistency and verify that dynamic memory management is robust (Table OO.A-7).
- 05Annex OO.D lists vulnerabilities for each key feature; your plans and standards must show how each one is avoided or verified.
Intuition
Think of it like a spare-parts catalogue
A pump that fits the same mounting, takes the same input and delivers at least the same flow can replace the original without re-certifying the whole engine. That is what a proper subclass is: a drop-in replacement for its parent. The danger in OO software is a subclass that looks like a drop-in part but quietly behaves differently, so code that was verified against the parent misbehaves when the child turns up at run time. DO-332 is mostly about proving your parts really are interchangeable, and about the hidden machinery (heaps, exceptions, implicit conversions) that OO languages bring along.
Why OO needed its own supplement
OO languages bring strong tooling, a large talent pool and reuse potential, but several features undermine the things DO-178C relies on: predictable control flow (dynamic dispatch decides at run time which method runs), traceability (a requirement implemented in a base class is silently inherited by subclasses), structural coverage (covering a call site once does not cover every method it may dispatch to), and resource predictability (heap allocation and exceptions). Industry and the FAA studied these for over a decade — the OOTiA Handbook (2004), FAA research on OO coverage and data/control coupling, CAST papers — and DO-332 (2011) consolidated the result.
DO-332 key features, the risk each brings, and the usual mitigation
| Feature | What can go wrong | Typical mitigation |
|---|---|---|
| Inheritance (single / multiple) | Subclass weakens parent behaviour; requirements silently inherited or overridden; diamond ambiguity with multiple inheritance | LSP-based type consistency; trace requirements to overriding methods; restrict multiple inheritance to interfaces |
| Dynamic dispatch (polymorphism) | Call site can run any of several methods; coverage and timing analysis must consider all of them | Local type consistency verification; bounded class hierarchies; flattened dispatch tables analysed for WCET |
| Parametric polymorphism (generics/templates) | Each instantiation is different object code; code verified for one type may not hold for another | Verify each instantiation, or show the template is verified for all types it is used with |
| Overloading | Wrong overload chosen by implicit resolution rules; reviewers misread intent | Coding standard limits; explicit types; reviews focused on resolution |
| Type conversion | Implicit narrowing, loss of precision, unchecked downcasts | Forbid implicit narrowing; checked downcasts only; static analysis |
| Exception management | Unhandled exceptions, exceptions escaping across components, hidden control flow | Documented exception strategy in the architecture; verify every raise has a handler |
| Dynamic memory management | Leaks, fragmentation, dangling references, unbounded allocation time | Allocate only at initialisation, pools, or a verified memory manager (objective OO11) |
| Virtualization | Interpreted or virtual-machine code is really data for another program; hypervisors share hardware | Treat interpreted code as software with its own level; apply DO-332 and partitioning guidance |
Inheritance, LSP and local type consistency
DO-332 adopts the Liskov Substitution Principle: if a property can be proven for objects of a type, it must also hold for objects of every subtype. In requirements terms, a subclass must satisfy all the requirements of its parent class. For each method it redefines, a subclass may not strengthen preconditions (demand more of the caller), may not weaken postconditions (promise less), and may not weaken invariants.
Worked example
An air data class that breaks LSP
A base class AirspeedSource has a method getCas() whose requirement says it returns calibrated airspeed in knots, valid from 30 to 450 kt, and never blocks. A subclass SyntheticAirspeed estimates airspeed from GPS and attitude for a degraded mode. Its getCas() only works above 60 kt (a stronger precondition) and may take several frames to converge (a weaker timing postcondition). Every caller that was verified against AirspeedSource can now receive a SyntheticAirspeed through dynamic dispatch. The subclass is not a proper subtype, and the hierarchy is not type-consistent. Either the design changes (make it a separate interface) or every caller must be re-verified with the subclass in mind.
Local type consistency (objective OO10) asks you to show that at every point where dispatch can happen, every class that could actually appear there is substitutable for the declared type. DO-332 allows several routes, and projects often mix them:
- —Formal verification of LSP — prove that each overriding method honours its parent’s contract (pre/postconditions, invariants). Fits well with formal methods.
- —Inherited requirements-based tests — run the parent class’s requirements-based tests against every subclass; a proper subclass must pass them all.
- —Pessimistic testing — at each dispatching call, test with every method that could be dispatched to. Simple to reason about, but expensive in large hierarchies.
Practitioner tip
Trace to methods, not classes
Classes are architecture; methods and attributes implement requirements. DO-332 expects requirements to trace to the methods that implement them, and when a subclass overrides a method, the parent’s requirement should also trace to the override — in addition to any subclass-specific requirements.
Dynamic memory and exceptions
Objective OO11 requires the dynamic memory scheme to be shown robust. DO-332 lists the classic failure modes your memory management design must address: ambiguous references (two owners of one object), fragmentation starvation (enough free memory, but not contiguous), deallocation starvation (garbage not reclaimed fast enough), heap exhaustion, premature deallocation (dangling pointers), lost updates and stale references (e.g. an object moved by a compacting collector), and unbounded allocation or deallocation time. Each must be prevented by design or detected by verification.
Two common strategies
Static-after-start
Managed heap in operation
For exceptions, DO-332 wants an explicit strategy in the architecture: which exceptions can be raised, where each is handled, and what the system does when one occurs. Verification must show the code follows the strategy — no exception can propagate out of a component unhandled, and handlers leave objects in a consistent state. Exception paths are control flow, so they count for coverage.
Vulnerabilities, coverage and planning
Annex OO.D is the heart of the supplement. For each key feature (inheritance, parametric polymorphism, overloading, type conversion, exception management, dynamic memory, virtualization) and for general issues (traceability, structural coverage, component usage, resource analysis) it lists vulnerabilities and points to the guidance that addresses them. DO-332 planning additions: describe in the plans how each applicable vulnerability is handled, describe any virtualization, and for reused components describe type consistency, requirements mapping and exception strategy across the boundary. Verification additions include checking class hierarchy against requirements and testing that constructors initialise objects to a state consistent with the class requirements.
Pitfall
Coverage that looks complete but is not
Statement and MC/DC coverage measured on source can look complete after one call through a dispatching site, even though half the possible target methods never ran there. Similarly, compilers generate hidden code for constructors, destructors, dispatch tables and template instances. Plan coverage so it accounts for dispatch targets and for compiler-generated code, and at level A include them in the source-to-object analysis.
Model-based development
OO inside generated code
Most model-based projects generate procedural C, so DO-332 rarely applies to the generated application. It becomes relevant when the generator emits C++ classes, when hand-written OO code is integrated with generated code, or when the tools themselves are OO (tool developers then apply DO-332 under DO-330). Check the generator’s output options: inheritance, virtual methods and dynamic allocation can sometimes be disabled in the code-generation configuration, which keeps the generated code out of DO-332’s scope.
What the auditor looks for
What the reviewer will ask
Where is your mapping from each Annex OO.D vulnerability to the standard, design rule or verification activity that handles it? How do you show local type consistency at each dispatch point? What does your coding standard allow — multiple inheritance, templates, exceptions, heap after start-up? How did coverage account for dispatch targets? Applicants new to OO are advised to start on a lower-level project and coordinate closely with the authority.
Self-check
A subclass overrides a method and accepts a narrower input range than its parent. Which LSP rule does this break?