Know or Go Practical Quest for Reliable Software



Similar documents
Anwendung von Polyspace im Software Entwicklungsprozess nach IEC München, , Dr.-Ing. Jörg Barrho

A Static Analyzer for Large Safety-Critical Software. Considered Programs and Semantics. Automatic Program Verification by Abstract Interpretation

Introduction to Software Engineering. 8. Software Quality

Comprehensive Static Analysis Using Polyspace Products. A Solution to Today s Embedded Software Verification Challenges WHITE PAPER

Static Analysis of Dynamic Properties - Automatic Program Verification to Prove the Absence of Dynamic Runtime Errors

When COTS is not SOUP Commercial Off-the-Shelf Software in Medical Systems. Chris Hobbs, Senior Developer, Safe Systems

Visualizing Information Flow through C Programs

Numerology - A Case Study in Network Marketing Fractions

Software Testing & Analysis (F22ST3): Static Analysis Techniques 2. Andrew Ireland

Overview Motivating Examples Interleaving Model Semantics of Correctness Testing, Debugging, and Verification

Certification of a Scade 6 compiler

Software testing. Objectives

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

Abstract Interpretation-based Static Analysis Tools:

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Sources: On the Web: Slides will be available on:

Logistics. Software Testing. Logistics. Logistics. Plan for this week. Before we begin. Project. Final exam. Questions?

CS 451 Software Engineering Winter 2009

FROM SAFETY TO SECURITY SOFTWARE ASSESSMENTS AND GUARANTEES FLORENT KIRCHNER (LIST)

Best Practices for Verification, Validation, and Test in Model- Based Design

Grigore Rosu Founder, President and CEO Professor of Computer Science, University of Illinois

Software Engineering. How does software fail? Terminology CS / COE 1530

Bergen Engines Products and Applications

The V-model. Validation and Verification. Inspections [24.3] Testing overview [8, 15.2] - system testing. How much V&V is enough?

Meeting DO-178B Software Verification Guidelines with Coverity Integrity Center

A Test Suite for Basic CWE Effectiveness. Paul E. Black.

Sample Exam Syllabus

LEVERAGING DEDUCTIVE VERIFICATION IN INDUSTRIAL CONTEXTS

Static analysis of numerical programs

Semantic Analysis: Types and Type Checking

F-22 Raptor. Agenda. 1. Motivation

Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur

Converting Models from Floating Point to Fixed Point for Production Code Generation

The programming language C. sws1 1

Software Engineering. Software Development Process Models. Lecturer: Giuseppe Santucci

El Dorado Union High School District Educational Services

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters


How Safe does my Code Need to be? Shawn A. Prestridge, Senior Field Applications Engineer

Die wichtigsten Use Cases für MISRA, HIS, SQO, IEC, ISO und Co. - Warum Polyspace DIE Embedded Code-Verifikationslösung ist.

Static Analysis of the Mars Exploration Rover Flight Software

R214 SPECIFIC REQUIREMENTS: INFORMATION TECHNOLOGY TESTING LABORATORY ACCREDITATION PROGRAM

How To Develop A Static Analysis System For Large Programs

Introduction to Automated Testing

Best-Practice Software Engineering: Software Processes to Support Project Success. Dietmar Winkler

Specification and Analysis of Contracts Lecture 1 Introduction

Software Testing. Quality & Testing. Software Testing

Revision History Revision Date Changes Initial version published to

Formal Verification and Linear-time Model Checking

How To Improve Software Quality

Oracle Solaris Studio Code Analyzer

Static Analysis. Find the Bug! : Analysis of Software Artifacts. Jonathan Aldrich. disable interrupts. ERROR: returning with interrupts disabled

Embedded Software Development with MPS

Standard for Software Component Testing

CS 2112 Spring Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

2. Analysis, Design and Implementation

Advances in Programming Languages

SCADE SUITE SOFTWARE VERIFICATION PLAN FOR DO-178B LEVEL A & B

Secure Software Programming and Vulnerability Analysis

Esa Jokioinen Rolls Royce Marine MUNIN Workshop at SMM. Trusted to deliver excellence

Verification and Validation of Software Components and Component Based Software Systems

Module 10. Coding and Testing. Version 2 CSE IIT, Kharagpur

Integrity Static Analysis of COTS/SOUP

Crash Course in Java

University of Paderborn Software Engineering Group II-25. Dr. Holger Giese. University of Paderborn Software Engineering Group. External facilities

Software Engineering 9.1. Quality Control

Static Analysis of Virtualization- Obfuscated Binaries

Glossary of Object Oriented Terms

Requirements-driven Verification Methodology for Standards Compliance

The C Programming Language course syllabus associate level

Software Testing Strategies and Techniques

Software Reliability Estimation Based on Static Error Detection

OpenACC 2.0 and the PGI Accelerator Compilers

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Testing Introduction. IEEE Definitions

Outline. 1 Denitions. 2 Principles. 4 Implementation and Evaluation. 5 Debugging. 6 References

The CompCert verified C compiler

Regression Verification: Status Report

Software Engineering Introduction & Background. Complaints. General Problems. Department of Computer Science Kent State University

Critical Systems Validation. Objectives

Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

MPLAB Harmony System Service Libraries Help

Software Engineering for LabVIEW Applications. Elijah Kerry LabVIEW Product Manager

Chapter 8 Software Testing

Programming and Software Development CTAG Alignments

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

Data Structure with C

MTU ONSITE ENERGY. Madrid, November 19 th, MTU Onsite Energy GmbH All rights reserved

Selecting Sensors for Safety Instrumented Systems per IEC (ISA )

Model Checking based Software Verification

APPROACHES TO SOFTWARE TESTING PROGRAM VERIFICATION AND VALIDATION

Introduction to Static Analysis for Assurance

Towards practical reactive security audit using extended static checkers 1

InvGen: An Efficient Invariant Generator

How To Write A Program Verification And Programming Book

Rigorous Software Engineering Hoare Logic and Design by Contracts

Coverity White Paper. Effective Management of Static Analysis Vulnerabilities and Defects

Static vs. Dynamic Testing How Static Analysis and Run-Time Testing Can Work Together. Outline

The Power of Ten Rules for Developing Safety Critical Code 1. Gerard J. Holzmann NASA/JPL Laboratory for Reliable Software Pasadena, CA 91109

Transcription:

Know or Go Practical Quest for Reliable Software Dr.-Ing. Jörg Barrho Dr.-Ing. Ulrich Wünsche AVACS Project meeting 25.09.2014 2014 Rolls-Royce Power Systems AG The information in this document is the property of Rolls-Royce Power Systems AG and may not be copied or communicated to a third party, or used for any purpose other than that for which it is supplied without the express written consent of Rolls-Royce Power Systems AG. This information is given in good faith based upon the latest information available to Rolls-Royce Power Systems AG, no warranty or representation is given concerning such information, which must not be taken as establishing any contractual or other commitment binding upon Rolls-Royce Power Systems AG or any of its subsidiary or associated companies. The ROLLS-ROYCE Name, RR badge and RR monogram logos are registered Trade Marks of Rolls-Royce plc.

Contents Rolls-Royce Power Systems Development of safety critical software Risk Analysis Risk Minimization Limits of support Conclusion 2

Our Products Rolls-Royce Power Systems AG High-speed Engines Distributed Energy Systems Medium-speed Engines Components Bergen Engines AS Complete Drive and Propulsion Systems up to 10,000 kw Gas Gensets up to 2,530 kw Diesel Gensets up to 3,250 kw Diesel Gensets for NPP up to 8,300 kw Diesel and Gas Engines up to 9,620 kw Injection Systems 3

Diverse Product Portfolio Propulsion & Power Generation Marine & Offshore Governmental C&I, Agriculture Underground Mining 4 Rail, Mining, Oil & Gas Power Generation

Diverse Product Portfolio Energy Solutions & Marine Medium Speed Bergen Engines AS Components Nuclear Power Plants Energy Solutions & Marine Medium Speed Injection Systems 5

Objects of IEC60880 In safety critical Instrumentation & Control systems for nuclear power plants software must be developed according to the recognized standard IEC60880. The standard provides requirements for the purpose of achieving highly reliable software. It addresses each stage of software generation and documentation, including: Requirements specification Design Implementation Verification, validation Operation 6

Provide Evidence to Trust Know Highly reliable software means RELIABLE SOFTWARE Each work product must be checked thoroughly After best analysis no doubt shall remain Proofs provide best evidence Or go Identify sources of doubt and remove root causes Fight failures systematically The unsuspecting will not stay in project for long 7

Safety Playground Process Conventional New Natural Language Interpretation Language sub set Manual process Debugging Trust commercial tools Review Dynamic sampling Requirements Specification Implementation Compilation Test Formal language Automatic test possible Qualified code generator skipped Verified tool Automatic Static proof 8

Risk Driven by Six Categories Data access conflict Data initialization, data out of range, type conversion, invalid pointers, data alignment, array sizes Defective operation Rounding, overflow, /0, scaling, side effects, precedence/execution order, array ranges Design error Specification incomplete, hardware access, specified execution order, abstraction level of specification Tool based errors Compiler faults/undefined behaviour, data coherence (prototypes, data declarations) Error handling Unhandled interrupts, error detection (reporting, default behaviour) Runtime limits Loop iteration count, excessive runtime, deadlocks 9

Procedural Coding: 71 Risks 10

Model Based: 27 Risks Remain 11

Detection Still Very Conventional Risk Category Method Data access conflict Defective operation Design error Tool based Error Handling Runtime limits Verification 5 4 11 21 7 48 Static Analysis 1 9 17 27 Execution Time check 3 3 Stack check 1 1 Rules check 5 14 19 Dynamic test 2 7 2 11 6 7 7 27 53 9 109 Manual checks 62/109: Verification, Dynamic test, 20 % of rules check 12

Properties to be Ensured Worst Case Execution Time Consumption of Memory (program/const and variable/stack) Absence of run time errors - division by 0, - numerical overflow, - access out of bounds Functional Properties Check of defined coding risk reductions (language subset) 13

Tool objectives Tool usability, support, and certifiability Tool resource consumption - Limitation in space consumption - Limitation in tool runtime Tool impact increases with - Quality of results (less false-positives, etc.) - Effectiveness Development process shall be accompanied by the tool - [Simplicity in use] 14

C Language Subset ANSI C ISO 9899:1989 => well used paths in compiler No floating point data (as int as possible) => integer promotion far from common sense No bitfields => allocation compiler specific No unions => ambiguous access methods No pointer arithmetics => bounds hard to identify No function pointers => traceability Control flow preferred over data driven => Better understanding Defined structure and formatting => reading focus on contents However: No quantitative figures on effects of measures available Code accessible to static analysis 15

Using Compilers is Dangerous The Situation Virtually all commercially available compilers have bugs Source code checks need continuous updating due to newly identified limiting rules Applying a test suite strongly binds to set of compiler flags Conventional Attempt for Resolution Compiler validation for limited language subset offered Compiler code coverage in validation is low One just cannot be sure Or a different approach Compcert (with subset preprocessor and validated assemblylinkage)? 16

Formal Specification in Frama-C /** Calculate Delta speed demand by processing speed-up and speed-down buttons.*/ /*@ requires -200 <= t_speedhold <= 200; assigns t_speedhold; behavior SpeedConst: assumes SpeedDown == 0; assumes SpeedUp == 0; ensures \result == 0; [..] behavior SpeedD1: assumes SpeedDown!= 0; assumes SpeedHold >= 0; ensures \result == -ENGINE_SPEED_SCALE; ensures t_speedhold == -1; [..] behavior SpeedU1: assumes SpeedDown == 0; assumes SpeedUp!= 0; assumes t_speedhold <= 0; ensures \result == ENGINE_SPEED_SCALE; ensures t_speedhold == 1; [..] complete behaviors; disjoint behaviors; */ Ansi C specification language ACSL Permits formal specification of behaviors Behavior proven vs. Abstract syntax tree Well possible for simple functions But Difficult to read for the untrained programmer Yet another tool Why not generate proven code from spec automatically? 17

Challenges Abstract Interpretation Control-driven vs data-flow driven algorithms - Control-flow driven designs Require less annotations Provide more precise results Model-generated code (e.g., SCADE) - Automation by integration required Function pointers and pointer arithmetics - Increase false-positives especially if pointers are shared over different calling contexts 18

Example: Signal Debouncing Propagate a logical TRUE iff Condition is TRUE for more than CountMax cycles Using a design verifier to prove absence of overflows with - Condition in [FALSE, TRUE] - CountMax in [1, INT32_MAX 1] is not feasible (after 15h of runtime and more 70GB of space consumption) 19

Concurrency Runaway Auto Synchronous Thread Interrupt Thread Pointer gets lost void Func1(void) { int a[3]; Func2(a); } static int *c; void Func2(int* b) { c=b; } void Func3(void) { /* use c */ } Version works better static int c[3]; void Func2(int b[3]) { int i; for(i=0;i<3;i++) c[i]=b[i]; } void Func3(void) { /* use c */ } 20

Data Driven Code Hard to Check Stimulated regularly, s in [0..4]; Using interval domains: code coverage ok a[1] never accessed => dead data int f(int s) { struct { int b,c; } a[3] = {{ 1, 2 }, { 2, 999 }, { 5, 0 }}; } static int t=0; if(s==a[t].b) t=a[t].c; return t; 21

Post Proof Debugging Coders and testers do not always believe in proofs Known fact: {x x N}: (2 * x) & 1 = 0 If the practical case is x=5 humans still check if 10 is an even number Assumption In software development everything is uncertain until each specific case is investigated (which is impossible in finite time). 22

Failure Culture: Fight until Done Failure count per module Singular case Specific to one module F Failures favourite biotope One specific type Number of modules 23

Conclusion Reliable software is product of risk minimization Prevention before Detection Commercially available analysis tools support safety process Specification error avoidance hardly available Still manual effort prevailing Provable compliance is not within reach yet 24

Quellen [IEC60880]: IEC60880:2006: Nuclear power plants Instrumentation and control systems important to safety Software aspects for computer-based system performing category A functions 25