Rail, Space, Security: Three Case Studies for SPARK 2014

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Configuration management
2009 – E. Félix Security DSL Toward model-based security engineering: developing a security analysis DSML Véronique Normand, Edith Félix, Thales Research.
Verification and Validation
A System to Generate Test Data and Symbolically Execute Programs Lori A. Clarke September 1976.
DETAILED DESIGN, IMPLEMENTATIONA AND TESTING Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
The design process IACT 403 IACT 931 CSCI 324 Human Computer Interface Lecturer:Gene Awyzio Room:3.117 Phone:
LIFE CYCLE MODELS FORMAL TRANSFORMATION
Software Construction
Presented by David LESENS and Johannes KANIG Thursday, 16 May 2013 Astrium Space Transportation AdaCore Formal Validation of Aerospace Software DASIA 2013.
Slide: 1 Copyright © 2014 AdaCore Claire Dross, Pavlos Efstathopoulos, David Lesens, David Mentré and Yannick Moy Embedded Real Time Software and Systems.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
An Integration of Program Analysis and Automated Theorem Proving Bill J. Ellis & Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt.
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
Software Engineering and Design Principles Chapter 1.
Introduction To System Analysis and Design
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 CMPT 275 Software Engineering Requirements Analysis Process Janice Regan,
A case study System to Software Integrity Matteo Bordin Jérôme Hugues Cyrille Comar, Ed Falis, Franco Gasperoni, Yannick Moy, Elie Richa.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
Ranga Rodrigo. Class is central to object oriented programming.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Software Quality Assurance Lecture #8 By: Faraz Ahmed.
Test Organization and Management
RUP Implementation and Testing
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
EMI INFSO-RI SA2 - Quality Assurance Alberto Aimar (CERN) SA2 Leader EMI First EC Review 22 June 2011, Brussels.
Configuration Management (CM)
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
WSMX Execution Semantics Executable Software Specification Eyal Oren DERI
Drexel University CS 451 Software Engineering Winter Yuanfang Cai Room 104, University Crossings
1 Introduction to Software Engineering Lecture 1.
UHD::3320::CH121 DESIGN PHASE Chapter 12. UHD::3320::CH122 Design Phase Two Aspects –Actions which operate on data –Data on which actions operate Two.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
© Andrew IrelandDependable Systems Group Static Analysis and Program Proof Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt University.
Slide: 1 Copyright © 2009 AdaCore GeneAuto for Ada and SPARK A verifying model compiler GeneAuto2 meeting (Toulouse) September 2009 Matteo Bordin
FDT Foil no 1 On Methodology from Domain to System Descriptions by Rolv Bræk NTNU Workshop on Philosophy and Applicablitiy of Formal Languages Geneve 15.
Software Debugging, Testing, and Verification Presented by Chris Hundersmarck November 10, 2004 Dr. Bi’s SE516.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Formal Methods.
Architecture Analysis Techniques
Presented by David LESENS Tuesday 29 November 2011 Hi-Lite project – Case Study ASTRIUM Space Transportation.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Rational Unified Process Fundamentals Module 4: Core Workflows II - Concepts Rational Unified Process Fundamentals Module 4: Core Workflows II - Concepts.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Copyright 1999 G.v. Bochmann ELG 7186C ch.1 1 Course Notes ELG 7186C Formal Methods for the Development of Real-Time System Applications Gregor v. Bochmann.
The PLA Model: On the Combination of Product-Line Analyses 강태준.
Principles of Programming & Software Engineering
Types for Programs and Proofs
Testing and Debugging PPT By :Dr. R. Mall.
C++ Plus Data Structures
Levels of Software Assurance in SPARK
HCI in the software process
Developing Applications
CodePeer Update Arnaud Charlet CodePeer Update Arnaud Charlet
Lecture 09:Software Testing
QGen and TQL-1 Qualification
AdaCore Technologies for Cyber Security
CodePeer Update Arnaud Charlet CodePeer Update Arnaud Charlet
QGen and TQL Qualification
Chapter 1 Introduction(1.1)
HCI in the software process
Department of Computer Science Abdul Wali Khan University Mardan
System to Software Integrity
Overview Activities from additional UP disciplines are needed to bring a system into being Implementation Testing Deployment Configuration and change management.
Update & Roadmap. Update & Roadmap Established Ada market “Helping to preserve investments done with Ada” “Provide new cost-effective ways to develop.
Executable Specifications
Presentation transcript:

Rail, Space, Security: Three Case Studies for SPARK 2014 Claire Dross, Pavlos Efstathopoulos, David Lesens, David Mentré and Yannick Moy ERTS 2010: introducing project Hi-Lite. case study on analysis of Tokeneer code with multiple approaches ERTS 2012: show integration of test & proof at the heart of project Hi-Lite, using toy case study ERTS 2014: report on 3 industrial case studies using the new version of SPARK language and tools, result of project Hi-Lite Embedded Real Time Software and Systems – February 5th, 2014

SPARK 2014

programming language for long-lived embedded critical software Ada 2012 and SPARK 2014 programming language for long-lived embedded critical software programming by contract Ada subset for formal verification practical formal verification

SPARK 2014 Value Proposition Functional Requirement Functional Verification Software Architecture Software Architecture Verification Unit Requirements Unit Verification SPARK 2014 addresses multiple verification objectives on the V cycle: Robustness verification usually performed with unit testing. Proof guarantees that no run time error can occur. Unit verificaton, also usually performed with unit testing. Proof guarantees that functional contracts specified on subprograms are fulfilled by the implementation. Software architecture verification, usually performed with manual reviews. Static analysis guarantees that dependence contracts on subprograms and packages are fulfilled by the implementation. Code Robustness Verification

SPARK 2014 Value Proposition (DO-178C Version) System Requirements High Level Requirements Software Architecture Low Level Requirements Software architecture is consistent Compliance Robustness SPARK tools operate at source level, so the Compliance&Robustness activity performed with SPARK must be completed by an activity showing Property Preservation between the Source Code and the Executable Object Code. This activity typically relies on the qualification material developer for the compiler. Source Code Accuracy Consistency Property Preservation Executable Object Code

Dynamic Verification Formal Verification SPARK 2014 Contracts Program Contract = agreement between client & supplier Contract = agreement between client & supplier caller & callee Dynamic Verification Formal Verification SPARK allows fine-grain combination of dynamic verification and formal verification of contracts.

Case Studies 3 case studies: different domains, different sizes, different expertise

Case study 1: Train Control Systems David Mentré Small case study, rail domain, user very knowledgable about formal methods (B method, formal verificaiton of C code) but new to Ada/SPARK Fully available on the Web (both code and report), see URL in paper

Open Source  no vendor lock-in Model based (SysML) openETCS Open Source  no vendor lock-in Model based (SysML) Formal methods  Strong guaranties of correctness “Open Proofs”  Everybody can re-check openETCS is a European project aming at developing an integrated toolchain for specification + development + verification of European Train Control System software

Formalization of the Correctness of Step Functions Has_Same_Delimiters? Get_Value? Minimum_Until_Point? Formalization of step functions, used to describe maximum speed allowed on rail segments Various query and build subprograms operate on step functions Full functional contracts developed for all of these Restrictive_Merge

Capturing objects in the requirements Results SPARK 2014 very good for: Capturing objects in the requirements Readability of the specifications (= contracts) Automatic proof of absence of run-time errors Automatic proof of simple functional contracts Dynamic verification of contracts and assertions SPARK 2014 is not good for: Proving existing code automatically without any modifications Proving automatically complex functional contracts Areas requiring improvements: Possibility to prove some properties interactively (in 2014 roadmap) Better diagnostic for incomplete loop invariants (in 2014 roadmap) Training for developers to use proof tools (available in SPARK Pro subscription) Workflow to make efficient use of developers’ time (in progress) Paper describes one case where it was necessary to rewrite one line of code to allow automatic proof. Paper describes one case where the most natural contract would not have been provable automatically, and one where proof could not be completely automated. Better diagnostic will be provided by displaying counter-examples when automatic proof fails. Existing workflow for previous versions of SPARK being currently updated, as new language and tools are much more powerful.

Case study 2: Flight Control and Vehicle Management in Space David Lesens Large case study over 3 years, space domain, user very knowledgeable about Ada and previous version of SPARK Detailed report published as paper at DASIA conference in 2013

On Board Control Procedure Software program designed to be executed by an OBCP engine, which can easily be loaded, executed, and also replaced, on-board the spacecraft OBCP code Complete representation of an OBCP, in a form that can be loaded on-board for subsequent execution OBCP engine Application of the on-board software handling the execution of OBCPs OBCP language Programming language in which OBCP source code is expressed by human programmers The largest part of the case study targeted the On Board Control Procedure, a standardized means for spacecrafts to receive and execute commands. Specifically, the OBCP engine was fully developed in SPARK.

Formalization of the Correctness of 1505 Subprograms Example: A list of event detection statuses Request to reset the detection status for Event procedure Reset_Event_Status (Event : in T_Event) with Post => not Event_Status (Event).Detection and (for all Other_Event in T_Event => (if Other_Event /= Event then Event_Status (Other_Event) = Event_Status'Old (Other_Event))); Post-condition The detection of event is reset For all other events The detection status is unchanged Full functional contracts developed for 1505 subprograms. The contract for Reset_Event_Status shows how a complex property can be expressed using quantified expressions and conditional expressions. Event1 Event2 Event3 Not detected Detected Event1 Event2 Event3 Not detected Detected Event1 Event2 Event3 Not detected Detected Event1 Event2 Event3 Not detected Detected

Automatic Proof Results Numerical control/command algorithms Mission and vehicle management Formal Verification of Aerospace Software, DASIA 2013, http://www.open-do.org/wp-content/uploads/2013/05/DASIA_2013.pdf Part # subprograms # checks % proved Math library 15 27 92 Numerical algorithms 30 265 98 Part # subprograms # checks % proved Single variable 85 268 100 List of variables 140 252 Events 24 213 Expressions 331 1670 Automated proc 192 284 74 On board control proc 547 2454 95 Results for the largest units of the 2 parts of the case study. Average % of checks automatically proved is 95%, even 98% for functional properties, and 100% for many units.

Proof of absence of run-time errors Results SPARK 2014 very good for: Proof of absence of run-time errors Correct access to all global variables Absence of out-of-range values Internal consistency of software unit Correct numerical protection Correctness of a generic code in a specific context SPARK 2014 is good for: Proof of functional properties Areas requiring improvements: Sound treatment of floating-points (done) Support of object oriented features (in 2014 roadmap) Helping user with unproved checks (in 2014 roadmap) Helping users by displaying counter-example when automatic proof fails, and guiding the process of writing supporting assertions for proofs (in particular loop invariants).

Case study 3: Biometric Access to a Secure Enclave Pavlos Efstathopoulos Small case study based on a large case study called Tokeneer commissioned by the NSA to assess usability of previous version of SPARK Security domain, user is a member of SPARK development team, very knowledgeable about SPARK Original case study fully available on the Web (code, reports, papers)

Tokeneer Overall development and verification plan of the original Tokeneer case study Aim of this case study was to translate existing SPARK 2005 code and contracts to SPARK 2014, and apply new toolset

Formalization of the “Admin” Package Aspect / Pragma Num. of occurrences Global 197 Refined_Global 71 Refined_Depends 40 Depends 202 Pre 28 Post 41 Assume 3 Loop_Invariant 10 Dataflow Refinement Information flow Functional contracts Full dependency, refinement and functional contracts added to a unit User guidance Assumptions

Readability of the formal specifications Results SPARK 2014 very good for: Readability of the formal specifications Expressing specification-only code SPARK 2014 is better than SPARK 2005 for: Analysis of code that was not analyzable with SPARK 2005 Automating proofs with less user efforts Proving complete functional behavior of functions Uncovering corner cases in specifications related to run-time checks Areas requiring improvements: Summary of proof results (done) Translation was a complete success. New toolset largely outperformed previous one.

Lessons Learned From 3 different experiences, similar conclusions drawn

large, expressive, analyzable language SPARK 2014 Strengths large, expressive, analyzable language better automation of proofs executable contracts 3rd place: much better automation of proofs obtained with new toolset, which makes it practical to target proof of functional properties in addition to absence of run-time errors 2nd place: possibility to execute contracts is essential to develop contracts, catch errors early, and in the future combine test & proof 1st place: new version of SPARK is a much larger subset of Ada, which allows using it for many more applications

code and specifications must be adapted SPARK 2014 Challenges code and specifications must be adapted static debugging of contracts need expert advice sometimes Common finding: expert advice is needed for more complex automatic proofs Related issue: need tool support for statically debugging incomplete contracts Unsurprisingly: although code and specifications can be both tested and proved, automatic proof requires some adaptations

SPARK in 2014

See http://www.adacore.com/sparkpro and http://www.spark-2014.org Roadmap Now available as beta First release April 2014 See http://www.adacore.com/sparkpro and http://www.spark-2014.org New LabCom ProofInUse between AdaCore and INRIA (hiring 2 R&D software engineer postdocs)

10:30 – 12:30 New Trends in Certification I Announcements Tomorrow Thursday: 8:00 – 8:50 (room Daurat) Information session on the working group on “Theorem Proving in Certification” 10:30 – 12:30 New Trends in Certification I 16:40 – 18:40 New Trends in Certification II