Certifying Auto-generated Flight Code Ewen Denney Robust Software Engineering NASA Ames Research Center California, USA.

Slides:



Advertisements
Similar presentations
© Telelogic AB Modeling DoDAF Compliant Architectures Operational Systems Technical.
Advertisements

MDI 2010, Oslo, Norway Behavioural Interoperability to Support Model-Driven Systems Integration Alek Radjenovic, Richard Paige The University of York,
Configuration Management
SOFTWARE TESTING. Software Testing Principles Types of software tests Test planning Test Development Test Execution and Reporting Test tools and Methods.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 24 Slide 1 Critical Systems Validation 2.
Alternate Software Development Methodologies
Assurance techniques for code generators Ewen Denney USRA/RIACS, NASA Ames Bernd Fischer ECS, U Southampton.
PROBLEMSOLUTION TECHNOLOGY Traceability relations between requirements and code are generally derived manually, and must be manually updated when software.
Software Quality Assurance Inspection by Ross Simmerman Software developers follow a method of software quality assurance and try to eliminate bugs prior.
GM-CMU Collaborative Research Laboratory Temporal Logics for Analyzing Hybrid Systems Simulation Traces.
Cleanroom Engineering and the B-Method: A Comparison Drew Connelly.
Illinois Institute of Technology
EE694v-Verification-Lect5-1- Lecture 5 - Verification Tools Automation improves the efficiency and reliability of the verification process Some tools,
Software Testing Prasad G.
Breakout Group 2: Software Quality Assurance Outcome 8/18/10 1.
Scalable and Flexible Static Analysis of Flight-Critical Software Guillaume P. Brat Arnaud J. Venet Carnegie.
Anne Mascarin DSP Marketing The MathWorks
Software Integration and Documenting
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
MapleSim and the Advantages of Physical Modeling
Expert System Presentation On…. Software Certification for Industry - Verification and Validation Issues in Expert Systems By Anca I. Vermesan Presented.
1 Software Testing (Part-II) Lecture Software Testing Software Testing is the process of finding the bugs in a software. It helps in Verifying and.
Chapter 2 The process Process, Methods, and Tools
Assurance techniques for code generators Ewen Denney USRA/RIACS, NASA Ames Bernd Fischer ECS, U Southampton.
Managing the development and purchase of information systems (Part 1)
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
1 New Development Techniques: New Challenges for Verification and Validation Mats Heimdahl Critical Systems Research Group Department of Computer Science.
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
1 Software Reliability Assurance for Real-time Systems Joel Henry, Ph.D. University of Montana NASA Software Assurance Symposium September 4, 2002.
West Virginia University Towards Practical Software Reliability Assessment for IV&V Projects B. Cukic, E. Gunel, H. Singh, V. Cortellessa Department of.
Testing Methods Carl Smith National Certificate Year 2 – Unit 4.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
The Volcano Optimizer Generator Extensibility and Efficient Search.
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.
Computational Logic QMUL 26 Mar 04 Verification of Safety Critical Software Nick Tudor tel:
 Dr. Syed Noman Hasany.  Review of known methodologies  Analysis of software requirements  Real-time software  Software cost, quality, testing and.
Requirements Validation
Software testing techniques Software testing techniques Object-oriented software testing Presentation on the seminar Kaunas University of Technology.
May08-21 Model-Based Software Development Kevin Korslund Daniel De Graaf Cory Kleinheksel Benjamin Miller Client – Rockwell Collins Faculty Advisor – Dr.
Using Symbolic PathFinder at NASA Corina Pãsãreanu Carnegie Mellon/NASA Ames.
1 Software Testing Strategies: Approaches, Issues, Testing Tools.
Software Quality Assurance and Testing Fazal Rehman Shamil.
Industrial Avionics Working Group 18/04/07 The Relationship Between the Design and Safety Domains in IAWG Modular Certification Part 2: Completeness of.
Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
© Andrew IrelandGrand Challenges for Computing Research 2004 The Verifying Compiler Andrew Ireland Dependable Systems Group School of Mathematical & Computer.
Lectures 2 & 3: Software Process Models Neelam Gupta.
Slide 1SATC June 2000 Dolores R. Wallace* NASA Goddard Space Flight Center Greenbelt, Maryland for the American Society.
SAMCAHNG Yun Goo Kim I. Formal Model Based Development & Safety Analysis II. UML (Model) Based Safety RMS S/W Development February KIM, YUN GOO.
Configuration Management
Software Engineering (CSI 321)
C++ Plus Data Structures
Requirements Engineering (continued)
Configuration Management
Verification and Validation Overview
runtime verification Brief Overview Grigore Rosu
Champions League Test Automation
Introduction to Software Testing
QGen and TQL-1 Qualification
QGen and TQL Qualification
CS240: Advanced Programming Concepts
Chapter 15 Debugging.
CSE 303 Concepts and Tools for Software Development
Software Verification and Validation
Software Verification and Validation
Software Verification and Validation
Introduction to Software Testing
Presentation transcript:

Certifying Auto-generated Flight Code Ewen Denney Robust Software Engineering NASA Ames Research Center California, USA

Auto-generated code at NASA Most NASA missions and projects use modeling tools like Simulink and Matlab Commercial code generators (e.g., Real-Time Workshop and MatrixX) are available and have been successfully used –X-43 Hyper-X: On-board flight- software generated from Simulink models –RASCAL: Helicopter control laws implemented using Real-Time Workshop "We never found any errors in the automatically generated code, so we were confident in creating a quick prototype for NASA.

Orion Software process

Autocode issues Dear Ewen, If you are using R14SP3 Simulink code generation products, please review the following information. If you are not using R14SP3 versions of MathWorks products, please disregard this message. We have identified bugs in R14SP3 Simulink^® code generation products, which in rare instances generate incorrect code that is not easily detected. These bugs have been fixed in subsequent releases: R2006a, R2006b, or the upcoming R2007a release. To prevent impact from these bugs, R14SP3 code generation software users should take the following actions: *Review Related Bug Reports with Potential Workarounds* You can find the documented issues and potential workarounds through the following links (login required): Bug Report Bug Report Bug Report Bug Report Bug Report Frequent updates - bug reports, work-arounds and fixes

Autocode issues Commercial code generators are black boxes –Not qualified so need to analyze generated code Historically buggy: despite extensive heritage, rare bugs still remain Cannot detect many bugs at model level or via simulation Code can be difficult to understand and review Math intensive code requires powerful analysis techniques Diverse source of knowledge Models not good for expressing requirements

Assurance strategies for autocoders Documentation –explain the code generation (and certification) process –increases transparency and trust in process Traceability –link elements of generation process –mandated by NASA standards Proof –for all possible inputs, –if the safety assumptions hold –then for all possible execution paths, –the safety requirements hold.

Product-oriented assurance Augment code generator to generate certificates together with code (aka. the verifying compiler approach) No need to qualify/re-qualify code generator Code certificates: –evidence of compliance with specific requirement –can be independently verified –generate automatically Support engineers doing software assurance –generate safety documentation for human analysts

AutoCert A code generator plug-in for certifying mathematical properties of auto-generated code

AutoCert/RTW A Real-Time Workshop plug-in for certifying mathematical properties of auto-generated code

Technical approach Combine generator with certification plug-in: AutoCert Generate certificates which can be verified independently (IV&V) Based on formal logic –Range of safety properties –Inferred annotations drive source-code analysis –Fully automated –Analysis provides tracing and documentation

Example: Coordinate systems Level 2 Coordinate Systems (CxP 70138): All pertinent geometric technical data … shall be in the coordinate systems described in this document. Problem: –Not directly represented in model or code –Transformations involve matrix algebra, etc.

Example: Coordinate systems tmpRe = 0.0; for( row = 0; row < 3; row++) for( col = row + 1; col<3; col++) { tmpRe = mx[row * 3 + col]; mx[row * 3 + col] = mx[col * 3 + row]; mx[col * 3 + row] = tmpRe; }

Example: Coordinate systems tmpRe = 0.0; for( row = 0; row < 3; row++) for( col = row + 1; col<3; col++) { tmpRe = mx[row * 3 + col]; mx[row * 3 + col] = mx[col * 3 + row]; mx[col * 3 + row] = tmpRe; } post forall x : int, y : int & (0 mx_prime(x + 3 * y) == mx(y + 3 * x)

Example: Coordinate systems tmpRe = 0.0; for( row = 0; row < 3; row++) for( col = row + 1; col<3; col++) { tmpRe = mx[row * 3 + col]; mx[row * 3 + col] = mx[col * 3 + row]; mx[col * 3 + row] = tmpRe; } post mx == trans(prime(mx))

Example: Coordinate systems tmpRe = 0.0; for( row = 0; row < 3; row++) for( col = row + 1; col<3; col++) { tmpRe = mx[row * 3 + col]; mx[row * 3 + col] = mx[col * 3 + row]; mx[col * 3 + row] = tmpRe; } post has_frame(prime(mx), dcm(ned, ecef)) & mx == trans(prime(mx)) has_frame(mx, dcm(ecef, ned))

Covariance matrices (PM, PP) in a Kalman filter must remain symmetric during update Individual matrix operations in the generated code must be checked: R+H*PM*H is symmetric Annotations are required Analysis tool generates annotations based upon idiomatic code patterns Example: Matrix symmetry K=PM*H'*inv(R+H*PM*H'); PP = (I-K*H)*PM*(I-K*H)' + K*R*K'; Embedded Matlab … for (eml_i0 = 0; eml_i0 < 2; eml_i0++) { for (eml_i1 = 0; eml_i1 < 2; eml_i1++) { eml_x11 = 0.0; for (eml_i2 = 0; eml_i2 < 2; eml_i2++) { eml_x11 += eml_dv0[eml_i0 + (eml_i2 << 1)] * eml_dv1[eml_i2 + (eml_i1 << 1)]; } eml_x[eml_i0 + (eml_i1 << 1)] = eml_R[eml_i0 + (eml_i1 << 1)] + eml_x11; }} RTW /* post forall eml_i0: int, eml_i1: int 0 <= eml_i0 < 2 & 0 <= eml_i1 < 2 => eml_x[eml_i0 + (eml_i1 << 1)] = eml_x[eml_i1 + (eml_i0 << 1)] */

Execution safety memory safety (array bounds) –Buffer overflows often lead to unsafe programs variable initialization before use –Uninitialized variables can cause unpredictable/unrepeatable behavior –Compilers only check for initialization of scalars –e.g.: RTW bug: uninitialized variables in demux blocks Execution safety requires that the constraints of the target language are not violated.

Other safety properties Vector/matrix properties –symmetry, triangularity, positive definiteness –quaternion, probability vector normalization Representation conventions –consistent use of physical units, coordinate systems –Euler angles: YPR vs RPY –quaternion handedness Signal properties –all bus data used, updated

Traceability Traceability: the ability to link requirements back to rationales and forward to corresponding design artifacts, code, and test cases

Traceability Traceability: the ability to link requirements back to rationales and forward to corresponding design artifacts, code, and proofs why is this line of code safe? code verification conditions assumptions how is this requirement satisfied? property verification conditions code

Autocode safety reports Verification says that the code is safe Certification says why the code is safe Code analysis generates safety report: explain how code complies with safety properties –Make assumptions and requirements explicit –Algorithms, formulas, equations used to implement blocks –Chain of reasoning from assumptions to requirements the variable rtb_GetVeci is in the coordinate frame Earth-Centric Inertial because it is defined by applying the ECEF to ECI transformation to the variable … which is in turn … support code reviews Traces between code, documentation and V&V artifacts

Certification browser Auto-generated code Proof Status Show obligations Safety Obligations Highlight code Formula or explanation

Advantages of approach Low to no false positives/negatives –Accurate analysis of loops, EML, buses Tight integration with Matlab tool suite –Minimal impact to existing process Can encode mathematical properties –Use automated theorem proving to check math Generates safety documentation –Multiple forms of evidence Traces code and model to verification artifacts Supports independent V&V Qualifiable: small kernel of trusted components

Future work Greater domain coverage –More Simulink blocks/EML functions –More properties (e.g., checking control laws) More extensive documentation –Integrated report for multiple properties, subsystems –Safety cases Tighter Matlab integration

Extra Slides

Example: Vector norms Intuitively: Probability vectors must be normalized Show preservation of norm by update operations Domain-specific requirement Requires code annotations

Tool architecture Small kernel of untrusted components - patterns and annotations untrusted

Qualification A code generator is qualified –with respect to a given standard –for a given project if there is sufficient evidence about the generator itself so that V&V need not be carried out on the generated code to certify it Must be done for every project, version –can obtain verification credit Generators are rarely qualified –ASCET-SE (IEC 61508), SCADE, VAPS (DO-178B) Qualifying code generators is (almost) infeasible!