Software Assurance in An Era of Complexity
Software Assurance in An Era of Complexity
David Peterson
Principal Airworthiness Standards Officer
Civil Aviation Safety Authority (CASA)
1969
2019
How do we assure the
airworthiness of systems
incorporating software?
Ariane 501
From the report:
• Disintegration at H0 + 39 (T+39 sec) due to aerodynamic loads
• Full deflection of Vulcain engine & SRB nozzles (commanded by on-board computer)
• OBC command based on INS value containing ‘diagnostic data’ (not measured data!)
• INS 2 (SNI 2) failure (and diagnostic triggered) due to a software exception
• Exception due to overflow during data conversion from 64 bit float → 16 bit signed integer
• Conversion unguarded due to performance constraints of embedded system
• Overflow due to unexpectedly high value of BH parameter (horizontal bias) (vs. Ariane 4)
• Also: INS 1 (SNI 1) unavailable – it failed (common mode) on the prior OBC data cycle
“the primary technical causes are the Operand Error when converting
the horizontal bias variable BH, and the lack of protection of this conversion
which caused the SRI computer to stop”
→ Error arose in INS ‘strap-down’ code – these results were unused after launch !!!
http://sunnyday.mit.edu/accidents/Ariane5accidentreport.html
What this talk is about
• Why do systems incorporating software fail?
(KSLOC)
24M SLOC
1.7M SLOC
• Tested ≠ Proven
• Learn from the past – shift focus from causes to reasons (ESW)
Also …
• DO-297 – IMA
• DO-254 – CEH
• DO-200 – Data
• DO-160 – Environmental
Aviation system/software assurance model
ARP 4754A
ARP 4761 Failure/criticality Aircraft & System
Safety Assessment FDAL (Appendix A)
Development
Process [functional level]
Process
SW reqs HW reqs
DO-178C DO-254
IDAL (DO- objectives)
Software Assurance Electronic Hardware
[item level]
The rapid increase in the use of software in airborne systems and equipment used on
aircraft and engines in the early 1980s resulted in a need for industry-accepted
guidance for satisfying airworthiness requirements. (…)
This document, now revised [to DO-178C] in light of experience, provides the aviation
community with guidance for determining, in a consistent manner and with an
acceptable level of confidence, that the software aspects of airborne systems comply
with airworthiness requirements.
The purpose of the software verification process is to detect and report errors that
may have been introduced during the software development process. Removal of the
errors is an activity of the software development process. The software verification
process verifies that:
a. The system requirements allocated to software have been developed into high-level
requirements that satisfy those system requirements.
b. The high-level requirements have been developed into software architecture and
low-level requirements that satisfy the high-level requirements. …
c. The software architecture and low-level requirements have been developed into
Source Code that satisfies the low-level requirements and software architecture.
d. The Executable Object Code satisfies the software requirements (that is, intended
function), and provides confidence in the absence of unintended functionality.
e. The Executable Object Code is robust with respect to the software requirements
such that it can respond correctly to abnormal inputs and conditions.
f. The means used to perform this verification are technically correct and complete for
the software level.
6.1 Purpose of Software Verification RTCA DO-178C pg. 39
Trace data
Trace data
Trace data
HLR LLR SC
The purpose of the software verification process is to detect and report errors that
(... tomay
System
have been introduced during the software development process. Removal of the
Requirements)
to to to
errors is an activity of the software development process. The software verification
process verifies that:
LLR SC EOC
a. The system requirements allocated to software have been developed into high-level
requirements that satisfy those system requirements.
b. The high-level requirements have been developed into software architecture and
low-level requirements that satisfy the high-level requirements. …
c. The software architecture and low-level requirements have been developed into
Source Code that satisfies the low-level requirements and software architecture.
d. The Executable Object Code satisfies the software requirements (that is, intended
function), and provides confidence in the absence of unintended functionality.
e. The Executable Object Code is robust with respect to the software requirements
such that it can respond correctly to abnormal inputs and conditions.
f. The means used to perform this verification are technically correct and complete for
the software level.
DO-178C - example
…
DO-178C
The DO-178C “interface”
For the regulator:
• Start of project: PSAC – Plan for Software Aspects of Certification
(identifies DAL), NAA LOI determined.
• End of project: SAS – Software Accomplishment Summary (out) and
SCI – Software Configuration Index (akin to a MDL).
• CAST 29 – COTS graphical processors (CGPs) [strictly, this relates to AEH, not SW]
• Addresses CGP “closed” hardware. Normal COTS part management practices not
enough for CGP.
• The consideration is that a common mode failure (of a single type of CGP) may
render multiple redundant displays inoperative.
Supplements
Supplements to DO-178C:
• DO-330 – Tool Qualification targeted to tool vendors
• DO-331 – Model-based Development (MBD)
• DO-332 – Object Oriented Technology and Related Techniques (OOT)
• DO-333 – Formal Methods (FM)
Example in use:
• A380 Cockpit displays (Thales)
• Similar to MATLAB “Simulink”
• Heavy use in Europe (particularly rail)
• Much of the guidance in DO-332 may be relevant even when OOT is not being
used in the project.
Formal Methods (DO-333)
• What? Proving the correctness of algorithms (and implementations)
with respect to a formal specification.
• Limitations – Typically, formal methods do not “verify” the software per se.
Formal methods verify the correctness of the safety and liveness properties
specified for the software. (Exception is when refinement is used e.g. seL4)
Model checking example – TLA+
• Use of model checking (“lightweight FM”) can lead to useful detection
of subtle errors in code.
• Experience with TLA+ at Amazon:
• SPARK 2014 extends Ada 2012 with verification conditions (VCs) that may be
discharged (proved) with a theorem prover.
• Uses the “Why3” verification suite to provide a number of SMT solvers: Alt-Ergo,
CVC3, YICES and Z3.
• Example in use:
• 2011 – NATS iFACTS enroute air traffic control system. (529 KSLOC of SPARK,
152K VCs, 98.7% automatically proven by solvers, ~200 VCs discharged manually).
(Note: this pre-dates SPARK 2014 and the latest solvers, so the numbers would be
better today!)
Formal verification example - SPARK
pragma Spark_Mode (On);
package Sorters is
type Array_Type is array ( Positive range <>) of Integer;
https://www.theatlantic.com/technology/archive/2017/09/saving-the-
world-from-code/540393/
4. Regulatory take-away
• Assuring the safety of software systems is HARD
• Certification is much more than a paperwork exercise
• What’s missing (particularly in terms of software and
system requirements) can be just as important as what’s
present!