tddd07 real-time systems lecture 9: dependability & designsimna73/teaching/reap/ht19/... · uml...

35
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 9: Dependability & Design Simin Nadjm-Tehrani Real-time Systems Laboratory Department of Computer and Information Science Linköping University 35 pages Autumn 2019

Upload: others

Post on 13-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

TDDD07 Real-time Systems

Lecture 9: Dependability & Design

Simin Nadjm-Tehrani

Real-time Systems Laboratory

Department of Computer and Information ScienceLinköping University

35 pagesAutumn 2019

Page 2: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

2 of 35 Autumn 2019

Two lectures

This lecture and part of lecture 9:

• Basic notions of dependability and redundancy in fault-tolerant systems

• Fault tolerance:– Relating faults/redundancy to distributed

systems from lectures 4-6– Relating timing and fault tolerance

Lecture 9: • Fault prevention and design aspects

Page 3: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

3 of 35 Autumn 2019

Treatment of faults

• Recall: four approaches for treating faults in dependable systems

• This lecture:1. Fault prevention2. Fault removal3. Fault tolerance4. Fault forecasting

Reading: Section 5.1 & 5.3 of article by Avezienis et al.

Also one article on platform-

independent design

Page 4: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

4 of 35 Autumn 2019

System requirements

• Functional requirements– Describe the main objectives of the system,

referred to as “correct service” earlier

• Extra-functional requirements – Also called non-functional properties (NFP)– Cover other requirements than those

relating to main function, in particular dependability attributes: the frequency and severity of acceptable service failures

• Example NFP– Timeliness, availability, energy efficiency

Page 5: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

5 of 35 Autumn 2019

Basic approach

Design for timeliness:

• define end-to-end deadlines• define deadlines for individual tasks • ascertain (worst case)

execution/communication time for each task/message

• document assumptions/restrictions• Prove/show that implementation

satisfies requirements

Page 6: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

6 of 35 Autumn 2019

So, what is so hard about this?

Page 7: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

7 of 35 Autumn 2019

Layers of design

Hardware support

System software support

(kernels, communication protocols)

Programming environment support

Application modelling support

Page 8: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

8 of 35 Autumn 2019

Fault prevention/removal

Where should we look to find

faults prior to operation?

Page 9: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

9 of 35 Autumn 2019

Historical snapshots

• Hardware design–1970´s Dedicated hardware–1980´s Micro computers & ASICS–1990´s High performance Micro

computers, FPGAs, MEMs–2000 ’s SoCware, multicore

• Earlier predictable hardware is replaced with components that are complex to analyse (including cache, pipeline)

Page 10: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

10 of 35 Autumn 2019

Layers of design

Hardware support

System software support (kernels)

Programming environment support

Application modelling support

Page 11: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

11 of 35 Autumn 2019

Historical snapshots

• Scheduling principles–1970´s Fixed priority scheduling–1980´s Multiprocessor, Dynamic–1990´s Incorporating shared

resources–2000´s Load variations,

Multicore scheduling• OS interfaces to optimise memory

management, prefetching instructions to boost performance

Page 12: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

12 of 35 Autumn 2019

Layers of design

Hardware support

System software support (kernels)

Programming environment support

Application modelling support

Page 13: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

13 of 35 Autumn 2019

Historical snapshots

• Programming environments– 1970´s ”High” level

programming– 1980´s Real-time specific: Ada – 1990´s OO languages,

languages with formalsemantics

– 2000´s Software libraries, reuse

• Automotive industry: AUTOSAR components

Page 14: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

14 of 35 Autumn 2019

Engineers: Fool me once, shame on you – fool me

twice, shame on me

Page 15: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

15 of 35 Autumn 2019

Software developers: Fool me N times, who cares, this is

complex and anyway no one expects software to work...

Page 16: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

16 of 35 Autumn 2019

Frequency of faults

10%7%

27%56%

Other

Code

Design

Requirements

[Jim Cooling 2003, cited from DeMarco78]

Page 17: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

17 of 35 Autumn 2019

Testing is not enough ...

If a test fails, what was the cause?

• Undocumented assumptions on operational conditions, external impact?

• Wrong program code?• Unexpected impact of OS functionality?• Hardware timing dependencies?• Embedded test code affecting timing?

Page 18: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

18 of 35 Autumn 2019

Platform-independent design

Eliminating “butterfly effect” means trying to isolate the impacts of different layers

Page 19: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

19 of 35 Autumn 2019

Back to basics

• define end-to-end deadlines– Model the environment!

• define deadlines for individual tasks– Specify system decomposition!

• ascertain (worst case) execution/communication time for each task/message– Assume hardware/bus characteristics!

• document assumptions/restrictions– Model, model, model!

• Prove/show that implementation satisfies requirements – Analyse models, then test implementation!

Page 20: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

20 of 35 Autumn 2019

An engineering discipline

Using mathematics can never be wrong!

Page 21: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

21 of 35 Autumn 2019

Non-digital hardware Extensive simulations of coupled aircraft flight dynamics and actuator dynamics

[P. Krus, 2000]

Page 22: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

22 of 35 Autumn 2019

Model-based development

In software-intensive systems: • Models as “higher level” programs

• Idea: use models to analyse the design, automatically generate code from the model!

• Adequate support for modularisation: Well-tested libraries with well-defined interfaces

Page 23: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

23 of 35 Autumn 2019

Layers of design

Hardware support

System software support (kernels)

Programming environment support

Application modelling support

Page 24: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

24 of 35 Autumn 2019

Historical snapshots

• Mathematical modelling & analysis tools– 1970´s Sequential systems– 1980´s Concurrent/Distributed

systems– 1990´s Timed models, Combining

discrete & continuous, UML– 2000’s Incorporation in CASE tools

• 2012 crossroad: Domain-specific or Unified?

Page 25: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

25 of 35 Autumn 2019

UML standard

• UML 2.0 models components with required and provided interfaces

• Family of modelling techniques that are a further development of languages in early 80’s, for example: Ward & Mellor Diagrams

• Next two slides from an example[Heitmeyer and Mandrioli, Wiley, 1996]

Page 26: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

26 of 35 Autumn 2019

Power plant• Transformation schemata for functional

part & dynamic monitoring part

Monitor

Compute

safety

state

Coolant tank

Temperature

Pressurecompute power prodn

Fuel tank

Power request

Power production

Coolant

OK

ModerateAlarm

HighAlarm

Cool ShutDown

Restart

Continue

Power request

Power production

Page 27: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

27 of 35 Autumn 2019

Monitor state machine

Normal

Alert

Off

HighAlarm

ShutDown

ModerateAlarm

Restart

ModerateAlarm

Cool

OK

No OutputModerateAlarm

Cool

OK

No Output

HighAlarm

No Output

HighAlarm

ShutDown

OK

Restart

Page 28: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

28 of 35 Autumn 2019

What do we want to do with models once we create them?

Page 29: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

29 of 35 Autumn 2019

Advances in 2000’s

• Tools to model digital hardware and software components, support for functional analysis by–Simulations

• Theory:–Formal verification of functional

properties–Semi-automatic code generation

Page 30: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

30 of 35 Autumn 2019

Simulations of a model

Need a unique interpretation:

• The language should be platform-independent

• The language should have (standard) operational semantics to enable “execution” of the model

Page 31: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

31 of 35 Autumn 2019

Simulations

What do they show?

Page 32: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

32 of 35 Autumn 2019

Formal techniques (proofs)

• Create counterexamples, remove (design) faults that lead to demonstrated bad things– debugging the design

• But also Prove that specific bad things never happen

• Can be automated, but suffer from combinatorial explosion

Page 33: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

33 of 35 Autumn 2019

Advanced techniques

• Smart data structures for efficient representation of state space

• Smart deduction engines (satisfiability checkers) that find proofs fast

• Smart abstractions of the design to capture the essential properties– Synchronous languages (e.g. Esterel,

Lustre), used for Airbus 320 software

Page 34: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

34 of 35 Autumn 2019

Historical snapshots

• Application modelling & analysis tools– 1970´s Sequential systems– 1980´s Concurrent/Distributed

systems– 1990´s Timed models, Combining

discrete & continuous, UML– 2000’s Incorporation in CASE tools

• 2012 crossroad: Domain-specific or Unified?

Page 35: TDDD07 Real-time Systems Lecture 9: Dependability & Designsimna73/teaching/REAP/HT19/... · UML standard • UML 2.0 models components with required and provided interfaces • Family

Undergraduate course on Real-time SystemsLinköping University

35 of 35 Autumn 2019

Adding time to UML

• Still in progress…• No industry-wide tool support

• Recent development: UML profile for Real-time and Embedded Systems (MARTE)

• Meta-models for a class of systems with timing and performance parameters

See case study paper Weissnegger et al.