Formal Specification and Verification of Avionics Software Claus - - PowerPoint PPT Presentation

formal specification and verification of avionics software
SMART_READER_LITE
LIVE PREVIEW

Formal Specification and Verification of Avionics Software Claus - - PowerPoint PPT Presentation

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Formal Specification and Verification of Avionics Software Claus Wonnemann June 7th, 2006 Claus Wonnemann Formal Specification and


slide-1
SLIDE 1

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions

Formal Specification and Verification

  • f Avionics Software

Claus Wonnemann June 7th, 2006

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-2
SLIDE 2

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions

Outline

1 Introduction

Software in the avionics domain Certification requirements Object-oriented technologies

2 Specification of the Java Flight Manager

Flight Management The Java Flight Manager Specification

3 Runtime Assertion Checking and Verification

Runtime Assertion Checking Verification

4 Conclusions

Wrap-up

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-3
SLIDE 3

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Software in the avionics domain

Commercial airplanes feature a high degree of computerization. Many onboard computer systems are safety-critical.

◮ Navigation and Pilotage Assistance. ◮ Engine Control and Breaking

Systems.

◮ Fly-by-Wire.

Airborne software products must be

  • fficially certified.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-4
SLIDE 4

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Software in the avionics domain

Commercial airplanes feature a high degree of computerization. Many onboard computer systems are safety-critical.

◮ Navigation and Pilotage Assistance. ◮ Engine Control and Breaking

Systems.

◮ Fly-by-Wire.

Airborne software products must be

  • fficially certified.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-5
SLIDE 5

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Software in the avionics domain

Commercial airplanes feature a high degree of computerization. Many onboard computer systems are safety-critical.

◮ Navigation and Pilotage Assistance. ◮ Engine Control and Breaking

Systems.

◮ Fly-by-Wire.

Airborne software products must be

  • fficially certified.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-6
SLIDE 6

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Software in the avionics domain

Commercial airplanes feature a high degree of computerization. Many onboard computer systems are safety-critical.

◮ Navigation and Pilotage Assistance. ◮ Engine Control and Breaking

Systems.

◮ Fly-by-Wire.

Airborne software products must be

  • fficially certified.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-7
SLIDE 7

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Software in the avionics domain

Commercial airplanes feature a high degree of computerization. Many onboard computer systems are safety-critical.

◮ Navigation and Pilotage Assistance. ◮ Engine Control and Breaking

Systems.

◮ Fly-by-Wire.

Airborne software products must be

  • fficially certified.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-8
SLIDE 8

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Software in the avionics domain

Commercial airplanes feature a high degree of computerization. Many onboard computer systems are safety-critical.

◮ Navigation and Pilotage Assistance. ◮ Engine Control and Breaking

Systems.

◮ Fly-by-Wire.

Airborne software products must be

  • fficially certified.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-9
SLIDE 9

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

RTCA/DO-178B

RTCA/DO-178B is the major requirements specification.

◮ “Software Considerations in Airborne Systems and Equipment

Certification.”

Adopted as an official guideline by the FAA in 1993. Airborne software products must comply with stated

  • bjectives.

Considers Structured Programming, not Object-Orientation. Objected-oriented technologies (OOT) are much less common in the avionics domain.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-10
SLIDE 10

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

RTCA/DO-178B

RTCA/DO-178B is the major requirements specification.

◮ “Software Considerations in Airborne Systems and Equipment

Certification.”

Adopted as an official guideline by the FAA in 1993. Airborne software products must comply with stated

  • bjectives.

Considers Structured Programming, not Object-Orientation. Objected-oriented technologies (OOT) are much less common in the avionics domain.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-11
SLIDE 11

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Object-Oriented Technology in Aviation

OOT is in many respects different from other approaches. For instance... RTCA/DO-178B requires the elimination of unused code.

◮ Polymorphism and dynamic dispatch obviously

complicate this task.

Objectet-Oriented Technology in Aviation-Program (OOTiA) addresses related issues and concerns.

◮ Initiated by FAA and NASA in 2001. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-12
SLIDE 12

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Object-Oriented Technology in Aviation

OOT is in many respects different from other approaches. For instance... RTCA/DO-178B requires the elimination of unused code.

◮ Polymorphism and dynamic dispatch obviously

complicate this task.

Objectet-Oriented Technology in Aviation-Program (OOTiA) addresses related issues and concerns.

◮ Initiated by FAA and NASA in 2001. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-13
SLIDE 13

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Object-Oriented Technology in Aviation

OOT is in many respects different from other approaches. For instance... RTCA/DO-178B requires the elimination of unused code.

◮ Polymorphism and dynamic dispatch obviously

complicate this task.

Objectet-Oriented Technology in Aviation-Program (OOTiA) addresses related issues and concerns.

◮ Initiated by FAA and NASA in 2001. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-14
SLIDE 14

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Elements of OOTiA

Considerations and recommended techniques were compiled in a preliminary handbook. The major issues include:

◮ Subtypes and Subclasses ◮ Memory Management ◮ Dead and Deactivated Code Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-15
SLIDE 15

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Elements of OOTiA

Considerations and recommended techniques were compiled in a preliminary handbook. The major issues include:

◮ Subtypes and Subclasses ◮ Memory Management ◮ Dead and Deactivated Code Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-16
SLIDE 16

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Software in the avionics domain Certification requirements Object-oriented technologies

Elements of OOTiA

Considerations and recommended techniques were compiled in a preliminary handbook. The major issues include:

◮ Subtypes and Subclasses ◮ Memory Management ◮ Dead and Deactivated Code

The OOTiA-Handbook repeatedly mentions Design by Contract and Formal Methods as suggested methodologies for software development in the avionics domain.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-17
SLIDE 17

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Flight Management

A Flight Manager is part of the onboard navigational equipment. A major task is the computation of trajectories.

◮ Must comply with air traffic rules. ◮ Has to consider the aircraft’s agility. ◮ Should be efficient and economic. ◮ Further constraints.

A reliable operation is critical for a safe flight.

◮ A failure is considered hazardous by

RTCA/DO-178B (2nd highest category).

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-18
SLIDE 18

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Flight Management

A Flight Manager is part of the onboard navigational equipment. A major task is the computation of trajectories.

◮ Must comply with air traffic rules. ◮ Has to consider the aircraft’s agility. ◮ Should be efficient and economic. ◮ Further constraints.

A reliable operation is critical for a safe flight.

◮ A failure is considered hazardous by

RTCA/DO-178B (2nd highest category).

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-19
SLIDE 19

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Flight Management

A Flight Manager is part of the onboard navigational equipment. A major task is the computation of trajectories.

◮ Must comply with air traffic rules. ◮ Has to consider the aircraft’s agility. ◮ Should be efficient and economic. ◮ Further constraints.

A reliable operation is critical for a safe flight.

◮ A failure is considered hazardous by

RTCA/DO-178B (2nd highest category).

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-20
SLIDE 20

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The Java Flight Manager

  • Developed by Thales Avionics in

Toulouse. For research purposes:

◮ Rapid prototyping of new

features.

◮ Investigation of OOT-related

risks and benefits.

◮ Java in the avionics domain.

The lateral module is subject to the formal specification.

◮ About 70 classes. ◮ Major phenomena have been specified. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-21
SLIDE 21

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The Java Flight Manager

  • Developed by Thales Avionics in

Toulouse. For research purposes:

◮ Rapid prototyping of new

features.

◮ Investigation of OOT-related

risks and benefits.

◮ Java in the avionics domain.

The lateral module is subject to the formal specification.

◮ About 70 classes. ◮ Major phenomena have been specified. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-22
SLIDE 22

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The Java Flight Manager

  • Developed by Thales Avionics in

Toulouse. For research purposes:

◮ Rapid prototyping of new

features.

◮ Investigation of OOT-related

risks and benefits.

◮ Java in the avionics domain.

The lateral module is subject to the formal specification.

◮ About 70 classes. ◮ Major phenomena have been specified. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-23
SLIDE 23

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The lateral module

Computes the lateral part of a trajectory. The trajectory construction is done in three subsequent steps:

◮ Stage 1: A loose set of legs. ◮ Stage 2: Fixed positions connected by straight lines. ◮ Stage 3: The final trajectory. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-24
SLIDE 24

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The lateral module

Computes the lateral part of a trajectory. The trajectory construction is done in three subsequent steps:

◮ Stage 1: A loose set of legs. ◮ Stage 2: Fixed positions connected by straight lines. ◮ Stage 3: The final trajectory. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-25
SLIDE 25

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The lateral module

Computes the lateral part of a trajectory. The trajectory construction is done in three subsequent steps:

◮ Stage 1: A loose set of legs. ◮ Stage 2: Fixed positions connected by straight lines. ◮ Stage 3: The final trajectory. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-26
SLIDE 26

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The lateral module

Computes the lateral part of a trajectory. The trajectory construction is done in three subsequent steps:

◮ Stage 1: A loose set of legs. ◮ Stage 2: Fixed positions connected by straight lines. ◮ Stage 3: The final trajectory. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-27
SLIDE 27

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The lateral module

Computes the lateral part of a trajectory. The trajectory construction is done in three subsequent steps:

◮ Stage 1: A loose set of legs. ◮ Stage 2: Fixed positions connected by straight lines. ◮ Stage 3: The final trajectory. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-28
SLIDE 28

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The Specification

The specification is usually model-based.

◮ Contracts are based on abstract model. ◮ Well supported by model fields in JML.

It refrains from using JML’s specification library.

◮ Java types are usually sufficient. ◮ Heavy burden for verification.

Emphasis on invariants instead of contracts.

◮ Reflect characteristics of entity.

Some benefits Formal specs convey an unambigous description. Enforce reflections on a system’s characteristics. Provide access for CASE tools.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-29
SLIDE 29

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The Specification

The specification is usually model-based.

◮ Contracts are based on abstract model. ◮ Well supported by model fields in JML.

It refrains from using JML’s specification library.

◮ Java types are usually sufficient. ◮ Heavy burden for verification.

Emphasis on invariants instead of contracts.

◮ Reflect characteristics of entity.

Some benefits Formal specs convey an unambigous description. Enforce reflections on a system’s characteristics. Provide access for CASE tools.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-30
SLIDE 30

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The Specification

The specification is usually model-based.

◮ Contracts are based on abstract model. ◮ Well supported by model fields in JML.

It refrains from using JML’s specification library.

◮ Java types are usually sufficient. ◮ Heavy burden for verification.

Emphasis on invariants instead of contracts.

◮ Reflect characteristics of entity.

Some benefits Formal specs convey an unambigous description. Enforce reflections on a system’s characteristics. Provide access for CASE tools.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-31
SLIDE 31

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The Specification

The specification is usually model-based.

◮ Contracts are based on abstract model. ◮ Well supported by model fields in JML.

It refrains from using JML’s specification library.

◮ Java types are usually sufficient. ◮ Heavy burden for verification.

Emphasis on invariants instead of contracts.

◮ Reflect characteristics of entity.

Some benefits Formal specs convey an unambigous description. Enforce reflections on a system’s characteristics. Provide access for CASE tools.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-32
SLIDE 32

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Example I: A Leg Transition

  • Model fields

Fix specPivotFix ; Fix specTurnStart ; Fix specTurnEnd ; Fix specCircleCenter ; double specAngular Distance; ...

Invariants

specDirection = specLogicalDirection = ⇒ specTurnStart ∢ specPivotFix ≈fp specBearingToFix specDirection = specLogicalDirection = ⇒ specTurnStart ∢ specPivotFix ≈fp (specBearingToFix + 180)|360 specTurnStart ֌ specPivotFix ≈fp specTAD ...

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-33
SLIDE 33

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Example I: A Leg Transition

  • Model fields

Fix specPivotFix ; Fix specTurnStart ; Fix specTurnEnd ; Fix specCircleCenter ; double specAngular Distance; ...

Invariants

specDirection = specLogicalDirection = ⇒ specTurnStart ∢ specPivotFix ≈fp specBearingToFix specDirection = specLogicalDirection = ⇒ specTurnStart ∢ specPivotFix ≈fp (specBearingToFix + 180)|360 specTurnStart ֌ specPivotFix ≈fp specTAD ...

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-34
SLIDE 34

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Example I: A Leg Transition

  • Model fields

Fix specPivotFix ; Fix specTurnStart ; Fix specTurnEnd ; Fix specCircleCenter ; double specAngular Distance; ...

Invariants

specDirection = specLogicalDirection = ⇒ specTurnStart ∢ specPivotFix ≈fp specBearingToFix specDirection = specLogicalDirection = ⇒ specTurnStart ∢ specPivotFix ≈fp (specBearingToFix + 180)|360 specTurnStart ֌ specPivotFix ≈fp specTAD ...

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-35
SLIDE 35

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The first invariant in JML

public instance invariant ( specDirection == specLogicalDirection ) ==> Cmp.apprEq( BasicGeo.computeBD( specTurnStart .specLatitude , specTurnStart .specLongitude , specPivotFix .specLatitude , specPivotFix . specLongitude )[0] , specBearingToFix );

JML-Specs are often lenghty and verbose.

◮ Difficult to comprehend and maintain. ◮ Facilitates introduction of errors.

Leads to programming-style specifications.

◮ Many typecasts. ◮ Numerous method calls. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-36
SLIDE 36

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

The first invariant in JML

public instance invariant ( specDirection == specLogicalDirection ) ==> Cmp.apprEq( BasicGeo.computeBD( specTurnStart .specLatitude , specTurnStart .specLongitude , specPivotFix .specLatitude , specPivotFix . specLongitude )[0] , specBearingToFix );

JML-Specs are often lenghty and verbose.

◮ Difficult to comprehend and maintain. ◮ Facilitates introduction of errors.

Leads to programming-style specifications.

◮ Many typecasts. ◮ Numerous method calls. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-37
SLIDE 37

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Example II: A double-linked tree

  • Used as a hierarchic route

representation. Properties of the tree should be expressed by invariants. For each node must hold: The parent reference of all children must point to this. If there is a parent node, it must have a child reference to this.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-38
SLIDE 38

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Example II: A double-linked tree

  • Used as a hierarchic route

representation. Properties of the tree should be expressed by invariants. For each node must hold: The parent reference of all children must point to this. If there is a parent node, it must have a child reference to this.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-39
SLIDE 39

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Problems with these invariants

public boolean add (Object o) { ((TreePart)o). setParent(this); return super.add(o); }

The atomicity of “structural”

  • perations cannot be

ensured. The use of Object.clone() to clone a node violates the invariants. setParent() and super.add() have both public visibility. Invariants get violated according to JML’s Visible State semantics.

◮ Invariants hold with KeY’s Observable State semantics.

Can be fixed through refactoring.

◮ Inheritance relation to superclass has to be broken. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-40
SLIDE 40

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Flight Management The Java Flight Manager Specification

Problems with these invariants

✂ ✂ ✄ ☎ ✆ ✁ ✂ ✂
✂ ✂ ✝ ☎ ✆ ✁ ✂ ✂
✂ ✟ ✠ ✡ ☎ ✆ ✁ ✂ ✂ ☛ ✂ ✟ ✠ ✞ ✂ ✟ ✠ ✄ ☎ ✆ ✁ ✂ ✂ ☛ ✂ ✟ ✠ ✞ ✂ ✟ ✠ ✝ ☎ ✆ ✁ ✂ ✂ ☛ ✂ ✟ ✠
✂ ✂ ✝ ☞ ☎ ✆ ✁ ✂ ✂
  • Object.clone

The atomicity of “structural”

  • perations cannot be

ensured. The use of Object.clone() to clone a node violates the invariants. The first attempt to adjust the cloned object’s references breaks the invariant. A clone method can be implemented without Object.clone(). Nevertheless: Visible State semantics too restrictive?

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-41
SLIDE 41

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Runtime Assertion Checking Verification

Runtime Assertion Checking

Runtime Assertion Checking (RAC) allows to test constraints at runtime. The JML-Distribution includes a RAC-Compiler (jmlc). Benefits An easy means to test both the code and the specification.

◮ Specification errors are usually quickly detected through tests.

Allows a clear separation of code and tests.

◮ Tests can be switched off at will to improve performance. ◮ No further defensive checks within the code necessary.

An additional benefit at no extra cost.

◮ If a specification exists, no further effort is necessary. ◮ jmlc accepts all legal JML and Java code. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-42
SLIDE 42

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Runtime Assertion Checking Verification

Runtime Assertion Checking

Runtime Assertion Checking (RAC) allows to test constraints at runtime. The JML-Distribution includes a RAC-Compiler (jmlc). Benefits An easy means to test both the code and the specification.

◮ Specification errors are usually quickly detected through tests.

Allows a clear separation of code and tests.

◮ Tests can be switched off at will to improve performance. ◮ No further defensive checks within the code necessary.

An additional benefit at no extra cost.

◮ If a specification exists, no further effort is necessary. ◮ jmlc accepts all legal JML and Java code. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-43
SLIDE 43

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Runtime Assertion Checking Verification

Runtime Assertion Checking

Runtime Assertion Checking (RAC) allows to test constraints at runtime. The JML-Distribution includes a RAC-Compiler (jmlc). Benefits An easy means to test both the code and the specification.

◮ Specification errors are usually quickly detected through tests.

Allows a clear separation of code and tests.

◮ Tests can be switched off at will to improve performance. ◮ No further defensive checks within the code necessary.

An additional benefit at no extra cost.

◮ If a specification exists, no further effort is necessary. ◮ jmlc accepts all legal JML and Java code. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-44
SLIDE 44

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Runtime Assertion Checking Verification

Runtime Assertion Checking (2)

To consider Poor runtime performance. Not every assertion is executable. RAC tools depart from JML’s logic.

Runtimes for Route #Legs jmlc (ms) javac (ms) Belfast/Liverpool 5 4493 227 Liverpool/Luton 7 6751 265 Geneva/Nice 18 46412 285 Luton/Paris de Gaulle 24 122126 316 Palma de Mallorce/London 32 216660 397 Luton/Nice 33 309465 370 Liverpool/Nice 34 362443 402 Palma de Mallorca/London 37 391441 413

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-45
SLIDE 45

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Runtime Assertion Checking Verification

Runtime Assertion Checking (2)

To consider Poor runtime performance. Not every assertion is executable. RAC tools depart from JML’s logic. Limited executability of quantified expressions.

◮ It must be possible to restrict the range to a finite set.

Frame conditions are not regarded. Invariant enforcement is limited.

◮ Invariants are only checked in the course of a method call. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-46
SLIDE 46

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Runtime Assertion Checking Verification

Runtime Assertion Checking (2)

To consider Poor runtime performance. Not every assertion is executable. RAC tools depart from JML’s logic. The expression a[x] == a[x] for a null field a or an

  • ut-of-range value x is:

◮ true in JML. ◮ causes an assertion error in jmlc. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-47
SLIDE 47

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Runtime Assertion Checking Verification

Verification with KeY

public boolean add (Object o) { ((TreePart)o). setParent(this); return super.add(o); }

Trajectory construction has been partially verified, e.g.:

◮ Maintenance of invariants

for the tree’s add method.

◮ The specified behavior of

LegFactory.merge- Procedures.

Invariants of a double-linked tree.

◮ Hold with KeY’s Observable State semantics.

Two method calls.

◮ Method contracts are used.

200 Nodes, 70 Branches.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-48
SLIDE 48

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Runtime Assertion Checking Verification

Verification with KeY

public static void mergeProcedures(Procedure t1, Procedure t2) { MyList l1 = t1.leavesList(); while (l1.size() > t1Index) { l1.remove(t1Index); } MyList l2 = t2.leavesList(); int remainderLength = l2.size() – t2Index; while (l2.size() > remainderLength) { l2.remove(0); } t1.add(t2); }

Trajectory construction has been partially verified, e.g.:

◮ Maintenance of invariants

for the tree’s add method.

◮ The specified behavior of

LegFactory.merge- Procedures.

Concatenates two leg sequences.

◮ Truncated at the front and at the back, respectively.

Two while-loops. 8950 Nodes, 204 Branches.

Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-49
SLIDE 49

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Wrap-up

Wrap-up

Scepticism towards OOT in the avionics domain.

◮ Incertitudes how certification requirements can be met.

Formal methods and DBC address OOT-related safety issues.

◮ Explicitely suggested by the OOTiA-Handbook.

Specification of the JFM indicates benefits and drawbacks.

◮ Unambiguous, enforces better design, accessibility to tools, ... ◮ Verbosity, limited readability, difficult semantics, LSP, ...

RAC can be used with no extra effort.

◮ Although: limitations of current RAC compiler.

Formal verification as the ultimate step towards integrity.

◮ Elaborate, but well justified for critical parts. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-50
SLIDE 50

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Wrap-up

Wrap-up

Scepticism towards OOT in the avionics domain.

◮ Incertitudes how certification requirements can be met.

Formal methods and DBC address OOT-related safety issues.

◮ Explicitely suggested by the OOTiA-Handbook.

Specification of the JFM indicates benefits and drawbacks.

◮ Unambiguous, enforces better design, accessibility to tools, ... ◮ Verbosity, limited readability, difficult semantics, LSP, ...

RAC can be used with no extra effort.

◮ Although: limitations of current RAC compiler.

Formal verification as the ultimate step towards integrity.

◮ Elaborate, but well justified for critical parts. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-51
SLIDE 51

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Wrap-up

Wrap-up

Scepticism towards OOT in the avionics domain.

◮ Incertitudes how certification requirements can be met.

Formal methods and DBC address OOT-related safety issues.

◮ Explicitely suggested by the OOTiA-Handbook.

Specification of the JFM indicates benefits and drawbacks.

◮ Unambiguous, enforces better design, accessibility to tools, ... ◮ Verbosity, limited readability, difficult semantics, LSP, ...

RAC can be used with no extra effort.

◮ Although: limitations of current RAC compiler.

Formal verification as the ultimate step towards integrity.

◮ Elaborate, but well justified for critical parts. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-52
SLIDE 52

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Wrap-up

Wrap-up

Scepticism towards OOT in the avionics domain.

◮ Incertitudes how certification requirements can be met.

Formal methods and DBC address OOT-related safety issues.

◮ Explicitely suggested by the OOTiA-Handbook.

Specification of the JFM indicates benefits and drawbacks.

◮ Unambiguous, enforces better design, accessibility to tools, ... ◮ Verbosity, limited readability, difficult semantics, LSP, ...

RAC can be used with no extra effort.

◮ Although: limitations of current RAC compiler.

Formal verification as the ultimate step towards integrity.

◮ Elaborate, but well justified for critical parts. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-53
SLIDE 53

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Wrap-up

Wrap-up

Scepticism towards OOT in the avionics domain.

◮ Incertitudes how certification requirements can be met.

Formal methods and DBC address OOT-related safety issues.

◮ Explicitely suggested by the OOTiA-Handbook.

Specification of the JFM indicates benefits and drawbacks.

◮ Unambiguous, enforces better design, accessibility to tools, ... ◮ Verbosity, limited readability, difficult semantics, LSP, ...

RAC can be used with no extra effort.

◮ Although: limitations of current RAC compiler.

Formal verification as the ultimate step towards integrity.

◮ Elaborate, but well justified for critical parts. Claus Wonnemann Formal Specification and Verification of Avionics Software

slide-54
SLIDE 54

Introduction Specification of the Java Flight Manager Runtime Assertion Checking and Verification Conclusions Wrap-up

Thank you!

Any questions?

Claus Wonnemann Formal Specification and Verification of Avionics Software