Requirements-based Software System Adaptation in Practice...

23
Lucretius: Foundations for Software Evolution University of Trento, Italy Requirements-based Software System Adaptation in Practice: the Zanshin Framework Vítor E. Silva Souza Federal University of Espírito Santo Vitória – ES, Brazil [email protected] http://www.inf.ufes.br/ ~ vitorsouza This material has been licensed under a Creative Commons Attribution 3.0 Unported license.

Transcript of Requirements-based Software System Adaptation in Practice...

!

Lucretius: Foundations for Software Evolution University of Trento, Italy

Requirements-based Software System

Adaptation in Practice: the Zanshin Framework

Vítor E. Silva Souza

Federal University of Espírito Santo

Vitória – ES, Brazil

[email protected]

http://www.inf.ufes.br/~ vitorsouza

This material has been licensed under a Creative Commons Attribution 3.0 Unported license.

!

A"bit"of"context"•  Work"done"at"the"Univ."of"Trento,"Italy,"during"my"PhD:"

– Advisor:"John"Mylopoulos;"–  Closest"collaborators:"Yiqiao"Wang"(Toronto),"William"N."Robinson"(Georgia"State),"Alexei"Lapouchnian"(Toronto);"

•  Now"currently"a"professor"at"the"Federal"University"of"Espírito"Santo"(Ufes)"–"Vitória,"ES"–"Brazil."

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 2"

!

Adap_ve"systems"and"feedback"control""

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 3"

!

The"Zanshin"approach"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 4"

!

The"Zanshin"framework"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 5"

!

Current"implementa_on:"OSGi"/"Eclipse"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 6"

adaptation

SimulationConsole

Remote two-way communication

RepositoryService

1: create and retrieve in-memory

model

g1

t1 d1

2: begin(), success(), fail(), ...

3: life-cycle methods called

4: AwReqscheck

6: retrieve

strategies specified for failed

AwReq

5: AwReq state change

7 (opt): use reconfiguration

8: send evolutioninstructions

core

controller

monitoring

ControllerService

ReconfigurationService

MonitoringService

AdaptationService

RuleEngine

Existing application

!

Experiments"•  Didac_c:"the"Mee_ng"Scheduler"[ER’11,"CSRD’12,"PhD];"•  Proofhofhconcept:"an"Adap_ve"CAD,"based"on"the"LAShCAD"[SEfSAS2,"CoopIS’12,"AhCAD"Tech."Rep.,"PhD];"

•  An"external"applica_on:"Russel"Bjork’s"ATM"simula_on"[SEAMS’13a];"

•  Comparison"with"an"architecturehbased"approach"(Rainbow):"the"ZNN.com"slashdot"effect"[SEAMS’13b]."

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 7"

In the remainder of this talk, we will see how Zanshin works (an overview) using the A-CAD as example.

!

Baseline:"goal"model"with"variability"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 8"

Generate optimizeddispatching instructions

Call taking Resourceidentification

Resourcemobilization

Incidentupdate

Registercall

Assign toincident

Resource datais up-to-date

Monitorresources

Crew members useMDTs properly

Fast arrival

Fast dispatching

Fast assistance

Dispatching occurs in 3 minAmbulances arrive in 8 min Incidents resolved in 15 min

AND

AND

AND

AND

ANDAND

AND

AND

Inputemergencyinformation

Search forduplicates Create new

incident or assign as duplicate

Detect callerlocation

Specifyconfiguration

of ambulances

Confirmincident

Determine bestambulances

Inform stations/ ambulances

Closeincident

Replaceambulance

Monitor statusof ambulances

Display departure/arrival

messages

Displaystatus of

ambulances

Up to 1500calls per day

Confirmcall

Get goodfeedback

Provide routeassistance

Driver knowsthe way

A-CAD assistsvia navigator

Staff memberassists via radio

OR

Gazetteerworking andup-to-date

Map retrieval

Obtain mapinfo manually

Check thegazetteer

Check papermap

OR

OR

MDTs communicateposition

Update positionof engagedambulances

Crew updatesposition via radio

ORDisplay

exceptionmessages

Displayexceptionmessages

Add tomessagequeue

OR

Low cost

Userfriendly GUIs

Monthly costbelow € <MaxCost>

Staff members seemessages in <S> secs

!

""""""""Step"1."Awareness"Requirements"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 9"

Generate optimizeddispatching instructions

Call taking Resourceidentification

Resourcemobilization

Incidentupdate

Registercall

Assign toincident

Resource datais up-to-date

Monitorresources

Crew members useMDTs properly

Fast arrival

Fast dispatching

Fast assistance

Dispatching occurs in 3 minAmbulances arrive in 8 min Incidents resolved in 15 min

AND

AND

AND

AND

ANDAND

AND

AND

Inputemergencyinformation

Search forduplicates Create new

incident or assign as duplicate

Detect callerlocation

Specifyconfiguration

of ambulances

Confirmincident

Determine bestambulances

Inform stations/ ambulances

Closeincident

Replaceambulance

Monitor statusof ambulances

Display departure/arrival

messages

Displaystatus of

ambulances

Up to 1500calls per day

Confirmcall

MaxFailure(0, 1d)

SuccessRate(75%)

not TrendDecrease(30d, 2)

NeverFail

AR7

SuccessRate(99%)

NeverFail

Get goodfeedback

SuccessRate(90%)

SuccessRate(90%)

(AR1)

(AR2)

Provide routeassistance

Driver knowsthe way

A-CAD assistsvia navigator

Staff memberassists via radio

OR

(AR3)

(AR4)

(AR5)

(AR12)

Gazetteerworking andup-to-date

MaxFailure(1, 7d)

Map retrieval

Obtain mapinfo manually

Check thegazetteer

Check papermap

OR

OR

(AR6)

MDTs communicateposition

MaxFailure(1, 1min)

Update positionof engagedambulances

Crew updatesposition via radio

OR(AR8)

(AR9)

(AR11)

Display exceptionmessages

Displayexceptionmessages

Add tomessagequeue

OR

(AR10) MaxSuccess(10, 1min)

Low cost

Userfriendly GUIs

Monthly costbelow € <MaxCost>

Staff members seemessages in <S> secs

NeverFail (AR13)

MaxFailure(<NoSM>, 1w)(AR14)

!

Some"AwReqs"of"the"AhCAD"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 10"

QC Ambulances arrive in 8 min should have 75% success rate; AR

3

Aggregate

The success rate of that same QC should not decrease 2 months in a row

AR4

Trend

Goal Register call should never fail; AR

15

Basic Task Get good feedback should succeed 90% of the time AR

12

Aggregate

QC Dispatching occurs in 3 min should never fail; AR

11

Basic

AwReq AR1 should succeed 90% of the time, consider-ing month periods AR

2

Aggregate

!

Runh_me"representa_on"of"requirements"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 11"

Instance (for this dispatch)

“If the quality constraint that prescribes ambulances should

arrive in 8 min fails, reconfigure”.

Class (from now on)

“If MDTs fail to communicate position every 13 seconds, relax

it to every 20 seconds”.

Reconfiguration Evolution

!

""""""""Step"2."System"Iden_fica_on"Generate optimized

dispatching instructions

Call taking Resourceidentification

Resourcemobilization

Incidentupdate

Registercall

Assign toincident

Resource datais up-to-date

Monitorresources

Crew members useMDTs properly

Fast arrival

Fast dispatching

Fast assistance

Dispatching occurs in 3 minAmbulances arrive in 8 min Incidents resolved in 15 min

AND

AND

AND

AND

ANDAND

AND

AND

Inputemergencyinformation

Search forduplicates Create new

incident or assign as duplicate

Detect callerlocation

Specifyconfiguration

of ambulances

Confirmincident

Determine bestambulances

Inform stations/ ambulances

Closeincident

Replaceambulance

Monitor statusof ambulances

Display departure/arrival

messages

Displaystatus of

ambulances

Up to <NoC>calls per day

Confirmcall

MaxFailure(0, 1d)

SuccessRate(75%)

not TrendDecrease(30d, 2)

NeverFail

AR7

SuccessRate(99%)

NeverFail

Get goodfeedback

SuccessRate(90%)

SuccessRate(90%)

NoC

NoSM

(AR1)

(AR2)

Provide routeassistance

Driver knowsthe way

A-CAD assistsvia navigator

Staff memberassists via radio

ORVP1

LoA

- Manual - Auto with confirmation - Automatic

(AR3)

(AR4)

(AR5)

(AR12)

Gazetteerworking andup-to-date

MaxFailure(1, 7d)

Map retrieval

Obtain mapinfo manually

Check thegazetteer

Check papermap

OR

OR

VP2

VP3

(AR6)

MDTs communicateposition

MaxFailure(1, 1min)

Update positionof engagedambulances

Crew updatesposition via radio

ORVP4

(AR8)

(AR9)

(AR11)

Display exceptionmessages

Displayexceptionmessages

Add tomessagequeue

ORVP5

(AR10) MaxSuccess(10, 1min)

Low cost

Userfriendly GUIs

Monthly costbelow € <MaxCost>

Staff members seemessages in <S> secs

NeverFail (AR13)

MaxFailure(<NoSM>, 1w)(AR14)

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 12"

!

Parameters,"indicators"and"rela_ons"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 13"

QC Dispatching occurs in 3 min should never fail; AR

11

Basic 1. Consider AwReqs as indicators of requirements convergence;

2. Elicit system parameters that can be tuned at runtime;

•  LoA: Level of Automation; •  VP1: goal Provide route

assistance; •  VP2: goal Map retrieval; •  VP3: goal Obtain map

info manually; •  VP4: goal Update position

of engaged ambulances; •  MST: Minimum Search

Time.

!

Parameters,"indicators"and"rela_ons"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 14"

3. Elicit the (qualitative) effect that changes in parameters have in indicators;

•  Δ(AR11/LoA) > 0 •  Δ(AR11/VP1) < 0 •  Δ(AR11/VP2) < 0 •  Δ(AR11/VP3) < 0 •  Δ(AR11/VP4) < 0 •  Δ(AR11/MST)[0, 180] > 0

|Δ(AR11/VP2)| > |Δ(AR11/LoA)| > |Δ(AR11/VP3)| > |Δ(AR11/VP1)| > |Δ(AR11/VP4)| > |Δ(AR11/MST)|

4. Refine these relations, e.g., establishing an order of effect, if possible;

5. Choose a reconfiguration algorithm…

!

Qualia:"customizable/extensible"algorithm"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 15"

!

""""""""Step"3."Evolu_on"Requirements"•  Reconfigura_on"–"solu_on"space:"

–  “If"dispatching"doesn't"occur"in"3"minutes,"reduce"the"_me"spent"searching"for"duplicates”;"

•  Evolu_on"–"problem"space:"–  “If"the"goal"of"registering"a"call"is"not"achieved"successfully,"retry"in"5"seconds"or"disable"caller"loca_on"detec_on”;"

–  “If"the"assump_on"that"resource"data"is"uphtohdate"is"false,"delegate"the"solu_on"to"a"staff"member”;"

–  “If"MDTs"fail"to"communicate"posi_on"every"13"seconds,"relax"it"to"every"20"seconds”."

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 16"

!

Adapta_on"specifica_on"AR Adaptation strategies (EvoReqs) Applicability

AR1 1.  Warning(“AS Management”); 2.  Reconfigure(Ø).

1.  Once per session; 2.  Always.

AR5 1. Delegate(“Staff Member”). 1.  Always AR8 1. RelaxReplace(D_MDTPos_20s);

2. RelaxReplace(AR8, AR8_45s); 3. RelaxReplace(AR8_45s, AR8_30s); 4. Retry(6000); 5. Reconfigure(Ø [Immediate resol.]).

1.  Once per session; 2.  Once per session; 3.  Once per session; 4.  3x per session; 5.  Always.

AR11 1.  Reconfigure({Oscillation Value Calculation, Oscillation Resolution Check});

2.  Reconfigure({Ordered Effect Parameter Choice} [order = descending]).

1.  Always;

2.  Always.

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 17"

E C A Operationalized by an algorithm.

!

Try"it"yourself!"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 18"

https://github.com/sefms-disi-unitn/Zanshin

https://github.com/sefms-disi-unitn/Zanshin/wiki

Source code for the Zanshin framework, simulations console and the “Zanshin-

managed” ATM software.

In the wiki, instructions on how to download Zanshin, how to run its simulations, how to

create your own models and simulations and how to run the ATM experiment.

!

Current"/"future"direc_ons"•  Further"development"of"the"prototype"framework;"•  Revision"of"its"base"model"(ontology"of"requirements);"•  LawReqs:"studying"the"rela_on"between"regulatory"compliance"and"adap_ve"systems"[SEAMS’13c];"

•  Move"towards"architecture:"modelhdriven"approach;"•  Handling"the"(many)"limita_ons"of"Zanshin:"

–  Too"much"responsibility"on"the"system"developer"(integra_on)"and"analysts"(consistency,"correctness);"

– No"support"for"legacy"/"3rd"party"systems;"– No"integra_on"with"domainhspecific"models;"– Qualia:"empty"procedures."

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 19"

!

References"•  SEfSAS2:"V."E."S."Souza,"A."Lapouchnian,"W."N."Robinson,"and"J."Mylopoulos,"“Awareness"Requirements,”"

in"Sovware"Engineering"for"SelfhAdap_ve"Systems"II,"vol."7475,"R."Lemos,"H."Giese,"H."A."Müller,"and"M."Shaw,"Eds."Springer,"2013,"pp."133–161."

•  ER’11:"V."E."S."Souza,"A."Lapouchnian,"and"J."Mylopoulos,"“System"Iden_fica_on"for"Adap_ve"Sovware"Systems:"a"Requirements"Engineering"Perspec_ve,”"in"in"Conceptual"Modeling"hh"ER"2011,"vol."6998,"M."Jeusfeld,"L."Delcambre,"and"T.hW."Ling,"Eds."Springer,"2011,"pp."346–361."

•  CSRD’12:"V."E."S."Souza,"A."Lapouchnian,"K."Angelopoulos,"and"J."Mylopoulos,"“Requirementshdriven"sovware"evolu_on,”"Computer"Science"h"Research"and"Development,"pp."1–19,"Springer,"2012."

•  CoopIS’12:"V."E."S."Souza,"A."Lapouchnian,"and"J."Mylopoulos,"“RequirementshDriven"Qualita_ve"Adapta_on,”"in"in"On"the"Move"to"Meaningful"Internet"Systems:"OTM"2012,"vol."7565,"R."Meersman,"H."Panexo,"T."Dillon,"S."RinderlehMa,"P."Dadam,"X."Zhou,"S."Pearson,"A."Ferscha,"S."Bergamaschi,"and"I."F."Cruz,"Eds."Rome,"Italy:"Springer,"2012,"pp."342–361."

•  A.CAD/Tech./Rep.:"V."E."S."Souza,"“An"Experiment"on"the"Development"of"an"Adap_ve"System"based"on"the"LAShCAD,”"available"online:"hxp://www.inf.ufes.br/~vitorsouza/ahcad/."Trento,"Italy,"2012."

•  PhD:"V."E."S."Souza,"“Requirementshbased"Sovware"System"Adapta_on,”"PhD"Thesis,"University"of"Trento,"Italy,"2012."

•  SEAMS’13a:"Tallabaci"and"V."E."S."Souza,"“Engineering"Adapta_on"with"Zanshin:"an"Experience"Report,”"in"Proc."of"the"8th"Interna_onal"Symposium"on"Sovware"Engineering"for"Adap_ve"and"SelfhManaging"Systems,"2013,"pp."93–102."

•  SEAMS’13b:"K."Angelopoulos,"V."E."S."Souza,"and"J."Pimentel,"“Requirements"and"Architectural"Approaches"to"Adap_ve"Sovware"Systems:"A"Compara_ve"Study,”"in"Proc."of"the"8th"Interna_onal"Symposium"on"Sovware"Engineering"for"Adap_ve"and"SelfhManaging"Systems,"2013,"pp."23–32."

•  SEAMS’13c:"S."Ingolfo"and"V."E."S."Souza,"“Law"and"Adap_vity"in"Requirements"Engineering,”"in"Proc."of"the"8th"Interna_onal"Symposium"on"Sovware"Engineering"for"Adap_ve"and"SelfhManaging"Systems,"2013,"pp."163–168."

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 20"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 21"

h;p://nemo.inf.ufes.br/"

This work has been supported by the ERC advanced grant 267856

“Lucretius: Foundations for Software Evolution” (April 2011 – March 2016)

– http://www.lucretius.eu.

Nemo is supported by Brazilian agency FAPES (www.fapes.es.gov.br)

through the PRONEX grant #52272362 and others.

!

“Vanilla”"requirements"# Requirement REQ-1 The system shall allow staff to register calls they receive from

citizens; REQ-2 The system shall, whenever possible, detect the location of the

caller and associate it with the call registry (public phones have associated locations, cell phones might be triangulated, etc.);

REQ-3 The system shall allow staff to dismiss calls as non-emergencies;

REQ-4 The system shall assist staff in identifying, through the information from the call, if it refers to an open incident in the system;

REQ-5 The system shall allow staff to assign calls to open incidents as duplicates or create new incidents for calls;

.

.

.

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 22"

!

Ini_al"goal"model"

September"2013" EASSy"2013"@"Shonan"Village"Center,"Kanagawa,"Japan" 23"