27
9th Bieleschweig Workshop M. Heisel Introduction Principles Terminology Phases Problem definition System design Software design Component specification Component implementation Quality assurance Relation to standards Conclusions Literature A Model-Based Development Process for Embedded Systems Ninth Bieleschweig Workshop, Hamburg, May 2007 Maritta Heisel Joint work with Denis Hatebur http://swe.uni-duisburg-essen.de Email: {Maritta.Heisel,Denis.Hatebur}@uni-due.de Universit¨ at Duisburg-Essen, Fakult¨ at f¨ ur Ingenieurwissenschaften, Abteilung Informatik und Angewandte Kognitionswissenschaft 1/ 28

Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

A Model-Based Development Process forEmbedded Systems

Ninth Bieleschweig Workshop, Hamburg, May 2007

Maritta Heisel

Joint work with Denis Hatebur

http://swe.uni-duisburg-essen.deEmail: {Maritta.Heisel,Denis.Hatebur}@uni-due.de

Universitat Duisburg-Essen, Fakultat fur Ingenieurwissenschaften,Abteilung Informatik und Angewandte Kognitionswissenschaft

1/ 28

Page 2: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

DePES I

• Concrete process for developing embedded systems.

• Consisting of 12 steps, including

• requirements analysis• system architecture• software architecture• component specification and implementation• systematic testing

• Each step results in some document(s).

• Expressed mostly in UML notations.

• Validation conditions for checking coherence betweendocuments.

2/ 28

Page 3: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

DePES II

• Developed over time and gradually improved in anindustrial context.

• Based on development processes for security- andsafety-critical systems according to the Common Criteriaand IEC 61508.

• Emerged from projects, e.g., development of smartcardoperating systems and applets for smartcards, and motorcontrol and automatic doors.

• For a complete description, see [Hat06].

3/ 28

Page 4: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Principles underlying DePES

• Clear terminology

• Thorough environment modeling

• Stress on problem analysis

• Pattern usage• problem frames• architectural styles• code patterns

• Model-based development• develop sequence of models, each describing different

aspects of the system/machine• models can be analyzed and checked for coherence

• Explicit process description with validation conditions

• Systematic testing

4/ 28

Page 5: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Terminology [Jac01]

Machine thing we are going to build; may consist ofsoftware and hardware

Environment part of the world where the machine will beintegrated

System consists of machine and its environment

Requirements optative statements; describe how theenvironment should behave when the machine isin action

Specification implementable requirements; describe themachine; are basis for its construction

Domain knowledge indicative statements; consist of facts andassumptions; needed to derive specification

5/ 28

Page 6: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Phases of DePES I

• Problem definition• Jackson-approach [Jac01] using problem frames• dependencies between subproblems are made explicit• specifications expressed using UML 2.0 sequence diagrams

• System design• system architecture defined using UML 2.0 composite

structure diagrams

• Software design• layered architecture• extended four-variable model• merge software architectures from subproblems

• Component specification• sequence diagrams for component interface• class diagrams and UML 2.0 state machines for component

description6/ 28

Page 7: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Phases of DePES II

• Software implementation

• coding patterns based on state machines available for Java

• Integration and testing

• testing against sequence diagrams set up in earlier phases• new: use state-machine approach to test against

requirements

7/ 28

Page 8: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

State problem, describe environment

• State requirements

• State facts and assumptions

• Model the environment using a context diagram

traffic lightscontrol

lights

crossingwaiting area waiting area

of secondary roadof main road

fire brigade

on lanes

vehicle_waiting

emergency_requestsee_redsee_greensee_yellow

enter,

enter,leave

enter,leave

leave

on, offbroken

road users

8/ 28

Page 9: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Decompose problem: problem diagrams

• Decompose problem into simple subproblems

TLCfault tolerance

tlc!{on,off}l!{broken}

lights R6light settings

R6 In case of a broken light bulb the trafficlights should blink in yellow for thesecondary road, after all red lights have beenswitched on for a period of time.

• Specify dependencies between subproblems:sequential, alternative, parallel

< start > ::= (< main passing > || < fire > || < broken light >)< main passing > ::= (MainRoadPassing < sec passing >)< sec passing > ::= (SecondaryRoadPassing < main passing >)< fire > ::= EmergencyRequestSecondaryRoadPassing

< main passing >< broken light > ::= BrokenLightSafeState

9/ 28

Page 10: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Fit subproblems to problem frames

Problem frames

• Are patterns for simple development problems

• Fitting a problem to some problem frame meansinstantiating the frame diagram

• Example: required behaviour problem frame

ControlCD!C2CM!C1

domainControlled

C

C3machine behaviour

Required

• Problem of previous slide is instance of required behaviour

10/ 28

Page 11: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Transform requirements into specifications I

For each subproblem:

• Use domain knowledge to transform non-implementablerequirements into specifications [JZ95].

• Express the specifications as sequence diagrams.• Validation condition: signals in sequence diagrams must

be the same as phenomena in machine interface ofproblem diagram.

sd

blink

BROKEN_BLINK

: lights

broken_light

: TLC fault tolerance

brokenconsider

broken

ref

11/ 28

Page 12: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Transform requirements into specifications II

sd

BROKEN_BLINK

: lights : TLC fault tolerance

sec_yellow

all_off

{t+0.9 .. t+1.1}

t=now

t=now

blink brokenignore

loop (1, *)

t=now

{t+0.9 .. t+1.1}

{t+2.9 .. t+3.1}

main_red

sec_red

unit =second

BROKEN_BLINK

all_off

BROKEN_ALL_WAIT

12/ 28

Page 13: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Set up system architecture

• System architecture consists of hardware and softwarecomponents

• Notation: UML composite structure diagrams

• Interface behavior of all programmable components mustbe specified using sequence diagrams

• Validation condition: to each programmable component,at least one subproblem must be associated.

: InductionLoop

Control

emergencyrequest button at

lights: LightsControl

:TrafficLights

Controller

srr_if

roadon secondaryto detect carsinduction loop

bl_if

fire brigade

er_if

lights_on_off

bl

lights_on_off_if

srr

TLC

13/ 28

Page 14: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Software design: layered software architecture

• Basic idea: application layer software should have the thesame interfaces as the machine, i.e., monitored andcontrolled variables [BH99].

• Thus, application layer becomes device-independent,device dependencies are factored out in IALs and HALs.

Actuators Sensors

Component Behavior (Phase 6)

^

Application Component Behavior (Phase 8)

^

Application Component Behavior (Phase 8)System Behavior (Phase 4) =

System Behavior (Phase 4) =

Application

Sensor IAL Actuator IAL

Sensor HAL Actuator HAL

Hardware

ControlComponent

14/ 28

Page 15: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Architectural patterns, global software architecture

• We have defined a layered architecture for each ofJackson’s problem frames [CHH05].

• Hence, for each subproblem fitted to a problem frame, weget a (preliminary) software architecture.

• The global software architecture is defined by merging thesubproblem architectures according to rules based on thesubproblem dependencies (problem definition phase)[CHH06].

15/ 28

Page 16: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Traffic light control: global software architecture

Driver Driver Driver Request

AbstractionIAL

TrafficLightApplication

InductionLoop LightsInterface

LightsDriver InductionLoop BrokenLight Emergency

Microcontroller

emergencyrequest button at

LightsControl

TrafficLightsController

er_if’bl_if’

lights_on_off_if’

lights_state_if

srr_if’

srr

irq8ports irq9irq7

induction loopto detect carson secondary

roadfire brigade

bl_if

lights_on_off_if

er_ifsrr_if

16/ 28

Page 17: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Component specification

• Interface specification using sequence diagrams

• Component description using interface classes and statemachines

• Validation conditions: state machine must be completeand generate the behavior stated in the sequence diagrams

sd InductionLoopIAL

InductionLoopIAL

srr ()

vehicle_ waiting ()

������

������

wait_for_srr

InductionLoopIAL

vehicle_waiting ()

srr () /

17/ 28

Page 18: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Component implementation: pattern for Java

Req (Id)

Busy

Idle

[Id>10] /Major (Id),MajorReq := Id

[Id<=10] /

MinorReq := IdMinor (Id),

public class ComponentName implements provided_if {

static final int IDLE = 0, BUSY = 1;

private req_if ri;

private int state;

...

public ComponentName (req_if ri_) {

state = ... // Init state

ri = ri_;

}

public void Req(int id) {

switch (state) {

case IDLE:

if (id<=10) {

if (ri!=NULL) ri.Minor (id); ....

state = BUSY;

} else {

if (ri!=NULL) ri.Major (id); ....

state = BUSY;

}

break;

default:

assert false: "FSM error Req";

}

} ...

}

19/ 28

Page 19: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Quality assurance

Achieved by

• Checking validation conditions as specified in processdescriptions

• Systematic testing

Systematic testing:

• Develop test cases during earlier phases of thedevelopment, i.e., before the implementation

• Test against requirements also, not only againstspecification

• For this purpose: model environment by stochasticprocesses (work in progress)

20/ 28

Page 20: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

DePES: all steps I

1. Describe problem

2. Consolidate requirements

3. Decompose problem

4. Derive a machine behavior specification for eachsubproblem

5. Design global system architecture

6. Derive specifications for all components of the globalsystem architecture

21/ 28

Page 21: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

DePES: all steps II

7. Design an architecture for all programmable componentsof the global system architecture that will be implementedin software

8. Specify the behavior of all components of all softwarearchitectures, using sequence diagrams

9. Specify the software components of all softwarearchitectures as state machines

10. Implement software components and test environment

11. Integrate and test software components

12. Integrate and test hardware and software

22/ 28

Page 22: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Relating software phases of DePES to CommonCriteria and ISO/IEC 61508 I

CC documents 61508 process step DePES

ST (Security Target) Software/E/E/PES safetyrequirements specification

1-4

ADV FSP (Func-tional Specification)

Specification part of Soft-ware/E/E/PES safety re-quirements specification

6

ADV ARC (SecurityArchitecture)

Software architecture 7

ADV TDS (TOE De-sign)

Software system design /Module design

8-9

ADV IMP (Imple-mentation represen-tation)

CODING 10

ADV = Assurance class for Development23/ 28

Page 23: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Relating software phases of DePES to CommonCriteria and ISO/IEC 61508 II

CC 61508 DePES

ATE DPT (Depth) Module and Integrationtesting

10

ATE FUN (Func-tional Tests)

Integration and validationtesting

11

ATE = Assurance class for TestingATE COV (Coverage) and ATE IND (Independent testing) arenot explicitly given in 61508 and DePES, but are part of therespective testing phases.DePES phases 5 and 12 are not mapped since these phasesconsider hardware.

24/ 28

Page 24: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

What do we gain by defining such a process? I

Fact

DePES is not a light-weight process!

• Certification according to safety- and security standards(IEC 61508 and Common Criteria) is supported.

• Sequence of well-defined steps helps developers to focusattention on relevant parts of the task (and fake a rationaldesign process ;-).

• Developed models and their interrelations can be checkedin each step.

• Special attention is paid to the analysis phase and themodeling of the environment. (Environment models yieldtest cases.)

25/ 28

Page 25: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

What do we gain by defining such a process? II

• Non-functional (quality) characteristics can be taken intoaccount (in particular, safety and security; by specificarchitectures and problem frames).

• Problem decomposition is performed explicitly andsystematically. Relations between subproblems areexploited to compose partial solutions of subproblems.

• Using patterns in various phases support re-use of existingknowledge and (partial) automation.

• Various possibilities for tools support:• UML tools available.• Tool for generating sequence diagrams available.• Model checker for UML state machines available.• Other tools conceivable.

• Process emerged from industrial practice, useswell-established languages and techniques.

26/ 28

Page 26: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Literature I

Ramesh Bharadwaj and Constance Heitmeyer.Hardware/Software Co-Design and Co-Validation using theSCR Method.In Proceedings IEEE International High-Level DesignValidation and Test Workshop (HLDV 99), 1999.

Christine Choppy, Denis Hatebur, and Maritta Heisel.Architectural patterns for problem frames.IEE Proceedings – Software, Special Issue on RelatingSoftware Requirements and Architectures, 152(4):198–208,2005.

Christine Choppy, Denis Hatebur, and Maritta Heisel.Component composition through architectural patterns forproblem frames.In Proc. XIII Asia Pacific Software Engineering Conference,pages 27–34. IEEE Computer Society, 2006.

27/ 28

Page 27: Bieleschweig A Model-Based Development Process for ...ifev.rz.tu-bs.de/Bieleschweig/B9/Heisel-Bieleschweig9-Model Based... · Software design Component specification Component implementation

9thBieleschweigWorkshop

M. Heisel

Introduction

Principles

Terminology

Phases

Problemdefinition

System design

Software design

Componentspecification

Componentimplementation

Qualityassurance

Relation tostandards

Conclusions

Literature

Literature II

Denis Hatebur.A pattern- and component-based process for embeddedsystems development.Master’s thesis, University Duisburg–Essen, 3 2006.http://swe.uni-duisburg-essen.de/intern/dpes.pdf.

Michael Jackson.Problem Frames. Analyzing and structuring softwaredevelopment problems.Addison-Wesley, 2001.

Michael Jackson and Pamela Zave.Deriving specifications from requirements: an example.In Proc. 17th Int. Conf. on Software Engineering, Seattle,USA, pages 15–24. ACM Press, 1995.

28/ 28