leveraging software design to guide the development of sense/compute/control applications ·...

112
Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications Damien Cassou

Upload: others

Post on 13-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Leveraging Software Design to Guide the Development of

Sense/Compute/Control Applications

Damien Cassou

Page 2: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

2

Design is CrucialThe most important ingredient in ensuring a software system’s long-term success is its design ”

ICSE’11 c.f.p

• A good design improves

• collaboration

• productivity

• maintenance

n536

[name > len]run_arch()

[name <= len]stop_arch()

n1704

start()

n822

n1155: lf

n1303error_mark

ArcCond

visb: string = unkn1304: Block

ArcCond

op: string = fct_calln1702: Operator

op: string = fct_calln1834: Operator

ArcCond ArcCond

n1966ualFctParam

ArcOpd[2]

n7848NameRef

ArcOpd[1]

name: string = exitvisb: string = pubvirtual: string = non-virtual

n391: Function

RefersTo

n7848NameRef

RefersTo

n7840NameRef

RefersTo

name: string = voidvisb: string = unk

n27: BuiltinType

Instance

n324Block

ArcCond

n162ForLoop

ArcSon

name: string = donevisb: string = unkstatic: bool = falseextern: bool = falseconst: bool false

n471: Object

ArcSon[1]

name: string = donen7846: NameRefRefersTo

name: string = donen7828: NameRef

RefersTo

value: string = 0n64: Literal

ArcSon[2]

value: string = lenn7820: NameRef

RefersTo

<< ActionState >>Suggest Itineraries

<<StartState . ActionState >>success

Try Again

<< EndState >>

error

<< ViewState >>Display Itineraries

success

Cancel

<< EndState >>startOver

<< ActionState >>Select Itineraries

success

<< SubFlowState >>Choose Itineraries

<< ActionState >>Book Itineraries

assign book

finish

Confirmation

success

Page 3: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

3

Design Framework

A good design requires a design framework which guides the architect with

• a language

• a paradigm

n536

[name > len]run_arch()

[name <= len]stop_arch()

n1704

start()

n822

n1155: lf

n1303error_mark

ArcCond

visb: string = unkn1304: Block

ArcCond

op: string = fct_calln1702: Operator

op: string = fct_calln1834: Operator

ArcCond ArcCond

n1966ualFctParam

ArcOpd[2]

n7848NameRef

ArcOpd[1]

name: string = exitvisb: string = pubvirtual: string = non-virtual

n391: Function

RefersTo

n7848NameRef

RefersTo

n7840NameRef

RefersTo

name: string = voidvisb: string = unk

n27: BuiltinType

Instance

n324Block

ArcCond

n162ForLoop

ArcSon

name: string = donevisb: string = unkstatic: bool = falseextern: bool = falseconst: bool false

n471: Object

ArcSon[1]

name: string = donen7846: NameRefRefersTo

name: string = donen7828: NameRef

RefersTo

value: string = 0n64: Literal

ArcSon[2]

value: string = lenn7820: NameRef

RefersTo

<< ActionState >>Suggest Itineraries

<<StartState . ActionState >>success

Try Again

<< EndState >>

error

<< ViewState >>Display Itineraries

success

Cancel

<< EndState >>startOver

<< ActionState >>Select Itineraries

success

<< SubFlowState >>Choose Itineraries

<< ActionState >>Book Itineraries

assign book

finish

Confirmation

success

Page 4: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Programming Framework

• abstractions

• services

4

A good implementation requires a programming framework which guides the developer with

Page 5: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Conformance

5

An implementation must conform to its design

n536

[name > len]run_arch()

[name <= len]stop_arch()

n1704

start()

n822

n1155: lf

n1303error_mark

ArcCond

visb: string = unkn1304: Block

ArcCond

op: string = fct_calln1702: Operator

op: string = fct_calln1834: Operator

ArcCond ArcCond

n1966ualFctParam

ArcOpd[2]

n7848NameRef

ArcOpd[1]

name: string = exitvisb: string = pubvirtual: string = non-virtual

n391: Function

RefersTo

n7848NameRef

RefersTo

n7840NameRef

RefersTo

name: string = voidvisb: string = unk

n27: BuiltinType

Instance

n324Block

ArcCond

n162ForLoop

ArcSon

name: string = donevisb: string = unkstatic: bool = falseextern: bool = falseconst: bool false

n471: Object

ArcSon[1]

name: string = donen7846: NameRefRefersTo

name: string = donen7828: NameRef

RefersTo

value: string = 0n64: Literal

ArcSon[2]

value: string = lenn7820: NameRef

RefersTo

<< ActionState >>Suggest Itineraries

<<StartState . ActionState >>success

Try Again

<< EndState >>

error

<< ViewState >>Display Itineraries

success

Cancel

<< EndState >>startOver

<< ActionState >>Select Itineraries

success

<< SubFlowState >>Choose Itineraries

<< ActionState >>Book Itineraries

assign book

finish

Confirmation

success

Page 6: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Requirements

1. A design framework to guide the architect

2. A programming framework to guide the developer

3. A guaranteed conformance of the implementation relatively to the design

6

Conformance

Page 7: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

7

Design

Implementation

Conformance

Related Works

Conformance

Page 8: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

8

GPL

Design

Implementation

Conformance

+

Related Works

Java

Conformance

Page 9: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

9

GPL Library

Design

Implementation

Conformance

+ ++

Related Works

Spring

Conformance

Page 10: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

10

GPL Library ADL

Design

Implementation

Conformance

++

+ ++

Related Works

C2

Conformance

Page 11: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

11

GPL Library ADL ADL++

Design

Implementation

Conformance

++ +

+ ++ +

+

Related Works

ArchJava

Conformance

Page 12: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

A paradigm-oriented framework for both design and implementation which maintains conformance all

along the software life-cycle

12

Thesis

Page 13: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

The Paradigm

13

applications that interactwith an environment

“ ”

Environment

Sense/Compute/Control (SCC)

Page 14: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

The SCC Paradigm

14

Environment

sense

compute

control

Page 15: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

The SCC Paradigm

15

sense

compute

control

computedirection

control aileron, engine

GPS,flight plan

Page 16: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

The SCC Paradigm

16

Environment

sense

compute

control

motion detection

intrusion?

trigger alarms

Page 17: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

The SCC Paradigm

17

Covers various domains

• pervasive computing

• tier-system monitoring

• avionics

• robotics

• ...

Environment

Page 18: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Contributions

18

1. A paradigm-specific design framework

2. A programming framework dedicated to a design

3. An evaluation of the approach

Page 19: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Contributions

19

1. A paradigm-specific design framework

2. A programming framework dedicated to a design

3. An evaluation of the approach

Page 20: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

20

Environment

orders

Page 21: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

20

Environment

orders• sources sense the environment

sources

Page 22: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

20

Environment

orders• sources sense the environment

sources

actions

• actions impact the environment

Page 23: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

20

Environment

orders

a concept for handling the interaction with

the environment

• sources sense the environment

sources

actions

• actions impact the environment

Page 24: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

20

Environment

orders

a concept for handling the interaction with

the environment

Entities

entity Keypad { source keycode as Integer; action UpdateSt;}

action UpdateSt { updateStatus(message as String);}

• sources sense the environment

sources

actions

• actions impact the environment

Page 25: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

21

Environment

orders

sources

actionsEntities

1 entity description for potentially many implementations

entity Keypad { source keycode as Integer; action UpdateSt;}

action UpdateSt { updateStatus(message as String);}

a concept for handling the interaction with

the environment

Page 26: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

22

Environment

orders

sources

actionsEntities

entity Keypad { source keycode as Integer; action UpdateSt;}

action UpdateSt { updateStatus(message as String);}

a concept for handling the interaction with

the environment

1 entity description for potentially many instances

Page 27: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

23

Environment

orders

sources

actionsEntities

entity Keypad { source keycode as Integer; action UpdateSt; attribute room as Integer;}action UpdateSt { updateStatus(message as String);}

➡ attributes to characterize instances(color, location, reliability, etc.)

1 entity description for potentially many instances

Page 28: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

24

Environment

orders

raw data a concept to refine raw data

sources

actionsEntities

Page 29: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

24

Environment

orders

raw data

contextoperators

a concept to refine raw data

refinedinformation

sources

actionsEntities

context BuildingSecured as Boolean { source keycode from Keypad;}

Page 30: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

25

Environment

orders

raw data

contextoperators

refinedinformation

sources

actionsEntities

a concept to take decisions based on

application-level data

Page 31: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

25

Environment

orders

raw data

contextoperators

refinedinformation

sources

actionsEntities

controller BuildingManager { context BuildingSecured; action UpdateSt on Keypad;}

controloperators

orders

a concept to take decisions based on

application-level data

Page 32: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

26

Environment

orders

raw data

contextoperators

sources

controloperators

refinedinformation

orders

actionsEntities

Sense

Compute

Control

The language features concepts dedicated to the SCC paradigm

Page 33: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

27

Environment

orders

contextoperators

sources

controloperators

refinedinformation

actionsEntities

Environment handlingApplication logic

Page 34: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

28

orders

contextoperators

controloperators

refinedinformation

Information use

Information creation

Page 35: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Design Language

29

Environment

orders

raw data

contextoperators

sources

controloperators

refinedinformation

orders

actionsEntities

Page 36: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

30

orderssources

controloperators

actions

contextoperators

Design Language

Page 37: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

31

orders

contextoperators

controloperatorscontrol

operators

sources

contextoperators

actions

Design Language

Page 38: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

32

contextoperators

controloperators

actions

sources

Page 39: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

32

contextoperators

controloperators

actions

sources

Intrusion

Page 40: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

32

contextoperators

controloperators

actions

sources

Intrusion

IntrusionManager

AlarmOnOff

Page 41: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

32

contextoperators

controloperators

actions

sources

Intrusion

BuildingSecured

Presence

IntrusionManager

AlarmOnOff

Page 42: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

32

contextoperators

controloperators

actions

sources

Intrusion

Keypadkeycode

MotionSensormotion

BuildingSecured

Presence

IntrusionManager

AlarmOnOff

Page 43: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

32

contextoperators

controloperators

actions

sources

Intrusion

Keypadkeycode

MotionSensormotion

BuildingSecured

Presence

SecurityManager

KeypadUpdateSt

IntrusionManager

AlarmOnOff

Page 44: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

32

contextoperators

controloperators

actions

sources

Intrusion

Keypadkeycode

Cameraimage

MotionSensormotion

BuildingSecured

Presence SceneImage

SecurityManager

KeypadUpdateSt

IntrusionManager

AlarmOnOff

MailerSend

Page 45: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

33

contextoperators

controloperators

actions

sources

Intrusion

Keypadkeycode

Cameraimage

MotionSensormotion

BuildingSecured

Presence SceneImage

SecurityManager

KeypadUpdateSt

IntrusionManager

AlarmOnOff

MailerSend

Page 46: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

34

BuildingSecured Presence

Intrusion

Page 47: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

34

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

what the architecthas in mind

Page 48: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

34

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

what the architecthas in mind

Page 49: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

34

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

what the architecthas in mind

Page 50: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

Page 51: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

Page 52: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

Page 53: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

Page 54: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

Page 55: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

Page 56: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

Page 57: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

Page 58: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

the architect should express what he has in mind

Page 59: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Case Study: Anti-Intrusion

35

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

BuildingSecured Presence

Intrusion

possibleinterpretations

the architect should express what he has in mind

➡interaction contracts

Page 60: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

36

contextoperator

Page 61: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

36

Activation condition1

contextoperator

1request

Page 62: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

36

Activation condition1

contextoperator

1event

Page 63: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

36

Activation condition1

Data requirement2 contextoperator

Entitysource context

operator

1event 2

request2

request

Page 64: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

36

Activation condition1

Data requirement2

Emission3

contextoperator

Entitysource context

operator

1event 2

request2

request

3 event

Page 65: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

37

Activation condition1

Data requirement2

Emission3BuildingSecured Presence

Intrusion

context Intrusion as Boolean { context Presence; context BuildingSecured; interaction { when provided Presence get BuildingSecured maybe publish }}

Page 66: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

37

Activation condition1

Data requirement2

Emission3BuildingSecured Presence

Intrusion

1

context Intrusion as Boolean { context Presence; context BuildingSecured; interaction { when provided Presence get BuildingSecured maybe publish }}

1

Page 67: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

37

Activation condition1

Data requirement2

Emission3BuildingSecured Presence

Intrusion

12

context Intrusion as Boolean { context Presence; context BuildingSecured; interaction { when provided Presence get BuildingSecured maybe publish }}

12

Page 68: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

37

Activation condition1

Data requirement2

Emission3BuildingSecured Presence

Intrusion

12

3

context Intrusion as Boolean { context Presence; context BuildingSecured; interaction { when provided Presence get BuildingSecured maybe publish }}

123

Page 69: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Interaction Contracts

37

Activation condition1

Data requirement2

Emission3BuildingSecured Presence

Intrusion

12

3

context Intrusion as Boolean { context Presence; context BuildingSecured; interaction { when provided Presence get BuildingSecured maybe publish }}

123 related to automata

approaches

Page 70: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Summary

A design framework consisting of a design language, DiaSpec, which guides the architect by offering

• concepts dedicated to the SCC paradigm

• a separation between environment handling and logic

• a separation between information creation and use

• a dedicated description of interactions

38

Page 71: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Contributions

39

1. A paradigm-specific design framework

2. A programming framework dedicated to a design

3. An evaluation of the approach

Page 72: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

A Programming Framework

40

Generated from the Design

GPLDiaSpec

Page 73: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

A Programming Framework

40

• separates 2 different roles with 2 different languages

• leverages GPL tools, libraries and expertise

• ensures conformance automatically

Generated from the Design

GPLDiaSpec

Page 74: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

41

A Programming Framework

how to make a programming framework conform to a

particular design?

Page 75: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

42

A Programming Framework

The code generator maps• each description to an abstract class• each interaction contract to an abstract method

Page 76: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

42

A Programming Framework

The code generator maps• each description to an abstract class• each interaction contract to an abstract method

By leveraging the GPL type checker, the framework• guides the implementation of what is required• forbids anything not specified in the design

Page 77: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

42

A Programming Framework

The code generator maps• each description to an abstract class• each interaction contract to an abstract method

different than what is proposed by ADLs or MDE

By leveraging the GPL type checker, the framework• guides the implementation of what is required• forbids anything not specified in the design

Page 78: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

43

Generationcontext Presence as Boolean { source motion from MotionSensor; interaction { when provided motion from MotionSensor get motion from MotionSensor always publish }}

abstract class AbstractPresence { abstract boolean onMotionFromMotionSensor( boolean motion, Select select);}

MotionSensormotion

Presence

Page 79: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

abstract class AbstractPresence { abstract boolean onMotionFromMotionSensor( boolean motion, Select select);}

44

Generationcontext Presence as Boolean { source motion from MotionSensor; interaction { when provided motion from MotionSensor get motion from MotionSensor always publish }}

MotionSensormotion

Presence

Page 80: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

abstract class AbstractPresence { abstract boolean onMotionFromMotionSensor( boolean motion, Select select);}

45

Generationcontext Presence as Boolean { source motion from MotionSensor; interaction { when provided motion from MotionSensor get motion from MotionSensor always publish }}

MotionSensormotion

Presence

Page 81: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

abstract class AbstractPresence { abstract boolean onMotionFromMotionSensor( boolean motion, Select select);}

46

Generationcontext Presence as Boolean { source motion from MotionSensor; interaction { when provided motion from MotionSensor get motion from MotionSensor always publish }}

①②

①②

according to the interaction contract

MotionSensormotion

Presence

Page 82: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

abstract class AbstractPresence { abstract boolean onMotionFromMotionSensor( boolean motion, Select select);}

47

Generationcontext Presence as Boolean { source motion from MotionSensor; interaction { when provided motion from MotionSensor get motion from MotionSensor always publish }}

②③

③ ②

MotionSensormotion

Presence

Page 83: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

48

Implementing the Behaviorcontext Presence as Boolean { source motion from MotionSensor; interaction { when provided motion from MotionSensor get motion from MotionSensor always publish }}

abstract class AbstractPresence { abstract boolean onMotionFromMotionSensor( boolean motion, Select select);}

class Presence extends AbstractPresence { boolean onMotionFromMotionSensor( boolean motion, Select select) { return motion; }}

Page 84: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

49

The developer needs to ask all motion sensors

Implementing the Behavior

class Presence extends AbstractPresence { boolean onMotionFromMotionSensor( boolean motion, Select select) { return motion; }}

when motion is detected ➡ there is presence

when motion is not detected? ➡ ?

Page 85: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

50

Entity Selection

Required when an entity is the interaction’s target

Guide the developer with an embedded and type-safe DSL

Page 86: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

51

Entity Selection

select.motionSensors().all()Select all motion sensors:

entity MotionSensor { source motion as Boolean; attribute room as Integer;}

Page 87: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

52

Entity Selection

select.motionSensors().whereRoom(between(1,3))

entity MotionSensor { source motion as Boolean; attribute room as Integer;}

Select all motion sensors in rooms 1 to 3:

room = 1 room = 2 room = 3

room = 4room = 0

1 2 3

40

Page 88: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

53

Commanding Entities

select.alarms().all().on();

entity Alarm { action OnOff { action OnOff; on();} off(); }

Triggering all alarms:

room = 4room = 0

Page 89: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

54

Entity Selection Conformance

select.alarms().all().start();

entity Alarm { action OnOff { action OnOff; on();} off(); }

It is not possible to send unsupported orders:

room = 4room = 0

compile-timeerror

Conformance

Page 90: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

55

Entity Selection

select.alarms().all();It is not possible to discover all kinds of entities:

room = 4room = 0

context Presence as Boolean { source motion from MotionSensor; interaction { when provided motion from MotionSensor get motion from MotionSensor always publish }}

Presence

MotionSensormotion

compile-timeerror

Conformance

Page 91: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

56

Implementing the Behaviorcontext Presence as Boolean { source motion from MotionSensor; interaction { when provided motion from MotionSensor get motion from MotionSensor always publish }}

abstract class AbstractPresence { abstract boolean onMotionFromMotionSensor(...);}

class Presence extends AbstractPresence { boolean onMotionFromMotionSensor( boolean motion, Select select) { if (motion) return true; MotionSensors sensors = select.motionSensors().all(); for (MotionSensor sensor : sensors) if (sensor.getMotion()) return true; return false; }}

Page 92: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Summary

The developer is guided with

• a support dedicated to the application• an embedded DSL for entity selection

Conformance is ensured by

• generating a programming framework

• leveraging a GPL type checker

57

Conformance

Page 93: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Contributions

58

1. A paradigm-specific design framework

2. A programming framework dedicated to a design

3. An evaluation of the approach

Page 94: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation of the Approach

• Expressiveness

• Usability

• Productivity

59

Page 95: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Expressiveness

Numerous domains

• home-automation

• avionics

• graphical user interfaces

• health-care

• telecommunications

• tier-system monitoring

• etc.

60

Page 96: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Usability

Context

• 80 students during 3 years

• sparse and oral-only documentation

Results

• 64 students completed the assignment

• Identification of the interaction contracts

61

Page 97: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

62

We measured the amount of code

generated automatically

Page 98: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

63

Framework82%

Implementation10%

Specification8%

Page 99: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

63

Framework82%

Implementation10%

Specification8%

➡ 76% actually executed

Page 100: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

64

Complexity of the developer’s code

We used the Sonar platform to measure code quality

through numerous metrics

Page 101: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

64

Complexity of the developer’s code

number of linearly independent paths in a source code“

”McCabe cyclomatic

complexity

Page 102: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

64

Complexity of the developer’s code

number of linearly independent paths in a source code“

”McCabe cyclomatic

complexity

∞3 7 101

Page 103: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

64

Complexity of the developer’s code

number of linearly independent paths in a source code“

”McCabe cyclomatic

complexity{quite well structured“ ”

∞3 7 101

Page 104: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

64

Complexity of the developer’s code

number of linearly independent paths in a source code“

”McCabe cyclomatic

complexity{quite well structured“ ” very poor quality“ ”

∞3 7 101

Page 105: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Evaluation: Productivity

64

Complexity of the developer’s code

number of linearly independent paths in a source code“

”McCabe cyclomatic

complexity{quite well structured“ ” very poor quality“ ”

∞3 7 101

on average

Page 106: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Summary

• The approach covers various domains

• The frameworks are easy to use

• Few code is required and this code is of good quality

65

Pursuing this evaluation with software engineers

Page 107: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

ResultsScientific contributions

• A design language dedicated to SCC (ICSE’11)

• The generation of a dedicated programming framework (GPCE’09)

• The evaluation of this approach (submitted)

Technical contributions

• A compiler for the design language (9 KLoC)

• A code generator targeting Java (4 KLoC)

Dissemination

• Demonstrations (PerCom’10), posters (SPLASH’10), visits (Bern, Potsdam)

• Public release (http://diasuite.inria.fr)

66

Conformance

Page 108: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

A Research Vehicle

67

This design language and code generator are part of a research project which involves

• 4 industrial partnerships

• 2 other research groups

• > 20 real applications

• 24/7 running platform

• 28,000 lines of code

Page 109: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

A Research Vehicle

68

7 PhD students leveraging DiaSpec and the generator

• QoS (FASE’11)

• error-handling (OOPSLA’10)

• virtual testing (Mobiquitous’09 and ’10)

• SIP (ICC’10, ICIN’09, IPTComm’08)

• end-user programming (DSLWC’09)

• security (ICPS’09)

Page 110: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Perspectives

69

requirements design code testing maintenance

• Can we transpose the approach to another paradigm?

• Can we support other stages of the software life-cycle?

• Can we help creating such approaches?

Page 111: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

70

Page 112: Leveraging Software Design to Guide the Development of Sense/Compute/Control Applications · 2014-10-05 · Leveraging Software Design to Guide the Development of Sense/Compute/Control

Facilitating Evolution

71

• eases developer’s work by• showing mismatches• leveraging development tools

• ensures conformance all along the software life-cycle