Dependability of Adaptable and Evolvable Distributed Systems SFM-16 - - PowerPoint PPT Presentation

dependability of adaptable and evolvable distributed
SMART_READER_LITE
LIVE PREVIEW

Dependability of Adaptable and Evolvable Distributed Systems SFM-16 - - PowerPoint PPT Presentation

Dependability of Adaptable and Evolvable Distributed Systems SFM-16 Bertinoro, June 2016 Carlo Ghezzi DEIB-Politecnico di Milano 1 Outline Of software and change Evolution, adaptation, self-adaptation How can they supported


slide-1
SLIDE 1

Dependability of Adaptable and Evolvable Distributed Systems

Carlo Ghezzi DEIB-Politecnico di Milano

1

SFM-16 Bertinoro, June 2016

slide-2
SLIDE 2

Outline

  • Of software and change
  • Evolution, adaptation, self-adaptation
  • How can they supported dependably?
  • How can dynamic evolution be supported for

continuously running systems?

2

slide-3
SLIDE 3

Software and change

3

slide-4
SLIDE 4

Facts

4

slide-5
SLIDE 5

Facts

  • Software undergoes continuous changes

4

slide-6
SLIDE 6

Facts

  • Software undergoes continuous changes
  • Unrivalled by any other technology

4

slide-7
SLIDE 7

Facts

  • Software undergoes continuous changes
  • Unrivalled by any other technology
  • Can be a problem

4

slide-8
SLIDE 8

Facts

  • Software undergoes continuous changes
  • Unrivalled by any other technology
  • Can be a problem
  • Can be an opportunity

4

slide-9
SLIDE 9

Evolution: positive view of change

Embeds the notions of

  • improvement
  • adaptation

5

slide-10
SLIDE 10

Formal methods can be integrated into software engineering practice to achieve dependability and effectively and efficiently turn change into evolution

6

slide-11
SLIDE 11

Why change?

7

slide-12
SLIDE 12

The world and the machine

8

We build (abstract) machines to achieve certain real-world goals, satisfy certain requirements

  • P. Zave, M. Jackson. Four dark corners of requirements engineering.

ACM Trans. Softw. Eng. Methodol. 6, 1 (January 1997)

slide-13
SLIDE 13

The world and the machine

8

We build (abstract) machines to achieve certain real-world goals, satisfy certain requirements

  • P. Zave, M. Jackson. Four dark corners of requirements engineering.

ACM Trans. Softw. Eng. Methodol. 6, 1 (January 1997)

slide-14
SLIDE 14

The world and the machine

8

We build (abstract) machines to achieve certain real-world goals, satisfy certain requirements

  • P. Zave, M. Jackson. Four dark corners of requirements engineering.

ACM Trans. Softw. Eng. Methodol. 6, 1 (January 1997)

Environment properties & assumptions

… they bridge the gap between requirements and specifications (M. Jackson & P . Zave)

slide-15
SLIDE 15

Software engineer's responsibilities

9

E S R

slide-16
SLIDE 16

Software engineer's responsibilities

  • Develop a specification S for the machine (and an

implementation) such, assuming that the environment behaves according to E, we can assure satisfaction of R

9

E S R

slide-17
SLIDE 17

Software engineer's responsibilities

  • Develop a specification S for the machine (and an

implementation) such, assuming that the environment behaves according to E, we can assure satisfaction of R

  • Formally,

9

E S R

slide-18
SLIDE 18

Software engineer's responsibilities

  • Develop a specification S for the machine (and an

implementation) such, assuming that the environment behaves according to E, we can assure satisfaction of R

  • Formally,

E & S ⊨ R

9

E S R

slide-19
SLIDE 19

Software engineer's responsibilities

  • Develop a specification S for the machine (and an

implementation) such, assuming that the environment behaves according to E, we can assure satisfaction of R

  • Formally,

E & S ⊨ R

9

Dependability argument E S R

slide-20
SLIDE 20

Change source: Getting the machine right

  • It is an evolutionary process
  • Software design is an exploratory activity
  • Software evolves from incomplete to a progressively

complete and stable solution

  • An then the solution becomes unstable to support further

evolution

10

slide-21
SLIDE 21

Change source: Requirements

  • Requirements are highly volatile
  • Hard to get
  • Change rapidly
  • Satisfaction of certain requirements generate new

requirements E & S ⊨ R

11

E S R

slide-22
SLIDE 22

Change source: Requirements

  • Requirements are highly volatile
  • Hard to get
  • Change rapidly
  • Satisfaction of certain requirements generate new

requirements E & S ⊨ R

11

R E S R

slide-23
SLIDE 23

Change source: Requirements

  • Requirements are highly volatile
  • Hard to get
  • Change rapidly
  • Satisfaction of certain requirements generate new

requirements E & S ⊨ R

11

R S E S R

slide-24
SLIDE 24

Change source: The environment

  • Getting environment properties and assumptions right is

hard

12

E S R

slide-25
SLIDE 25

Change source: The environment

  • Getting environment properties and assumptions right is

hard

12

  • Properties
  • Domain laws (e.g., physics)
  • R: move a body from A to B
  • D: suitable force A->B causes motion A->B
  • S: send suitable force command to actuator

E S R

slide-26
SLIDE 26

Change source: The environment

  • Getting environment properties and assumptions right is

hard

12

E S R

slide-27
SLIDE 27

Change source: The environment

  • Getting environment properties and assumptions right is

hard

12

  • Assumptions
  • Uncertain/incomplete/changeable knowledge
  • R: guarantee given avg response time to users
  • D: avg traffic X transactions/msec.

E S R

slide-28
SLIDE 28

Change source: The environment

  • Getting environment properties and assumptions right is

hard

12

E S R

slide-29
SLIDE 29

More on properties vs. assumptions

  • Property
  • it holds regardless of any software-to-be; e.g. physics’ laws

avgTrainAcceleration (t1, t2) > 0 implies trainSpeed (t2) > trainSpeed (t1)

  • Assumption
  • may expect a violation

“temperature is in the range -40..+40 Celsius” “device generates a measure every 2 ms.” “humans behave as instructed by the machine”

13

slide-30
SLIDE 30

Change source: The environment

14

slide-31
SLIDE 31

Change source: The environment

14

  • Often wrong properties/assumptions are hypothesized
  • Often assumptions made at design time are uncertain
  • Often assumptions change
slide-32
SLIDE 32

E & S ⊨ R

Change source: The environment

14

  • Often wrong properties/assumptions are hypothesized
  • Often assumptions made at design time are uncertain
  • Often assumptions change
slide-33
SLIDE 33

E & S ⊨ R

Change source: The environment

14

  • Often wrong properties/assumptions are hypothesized
  • Often assumptions made at design time are uncertain
  • Often assumptions change

E

slide-34
SLIDE 34

E & S ⊨ R

Change source: The environment

14

  • Often wrong properties/assumptions are hypothesized
  • Often assumptions made at design time are uncertain
  • Often assumptions change

S E

slide-35
SLIDE 35

The (in)famous Airbus accident (Sept. 1993)

15

slide-36
SLIDE 36

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
slide-37
SLIDE 37

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
  • Machine Spec: ActuateRevThrust —> WheelPulsesOn
slide-38
SLIDE 38

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
  • Machine Spec: ActuateRevThrust —> WheelPulsesOn
  • Assumptions:
slide-39
SLIDE 39

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
  • Machine Spec: ActuateRevThrust —> WheelPulsesOn
  • Assumptions:

WheelPulsesOn <—> WheelsTurning

slide-40
SLIDE 40

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
  • Machine Spec: ActuateRevThrust —> WheelPulsesOn
  • Assumptions:

WheelPulsesOn <—> WheelsTurning ActuateRevThrust <—> ReverseThrust

slide-41
SLIDE 41

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
  • Machine Spec: ActuateRevThrust —> WheelPulsesOn
  • Assumptions:

WheelPulsesOn <—> WheelsTurning ActuateRevThrust <—> ReverseThrust Sensor/actuator correctness assumption

slide-42
SLIDE 42

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
  • Machine Spec: ActuateRevThrust —> WheelPulsesOn
  • Assumptions:

WheelPulsesOn <—> WheelsTurning ActuateRevThrust <—> ReverseThrust WheelsTurning <—> TouchedDown Sensor/actuator correctness assumption

slide-43
SLIDE 43

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
  • Machine Spec: ActuateRevThrust —> WheelPulsesOn
  • Assumptions:

WheelPulsesOn <—> WheelsTurning ActuateRevThrust <—> ReverseThrust WheelsTurning <—> TouchedDown Sensor/actuator correctness assumption

slide-44
SLIDE 44

The (in)famous Airbus accident (Sept. 1993)

15

  • Requirement: ReverseThrust —> TouchedDown
  • Machine Spec: ActuateRevThrust —> WheelPulsesOn
  • Assumptions:

WheelPulsesOn <—> WheelsTurning ActuateRevThrust <—> ReverseThrust WheelsTurning <—> TouchedDown Sensor/actuator correctness assumption

slide-45
SLIDE 45

The notion of failure

  • Failure = broken dependability argument
  • Functional or nonfunctional failure
  • not necessarily a "catastrophic event"
  • includes violation of quality of service, which may

lead to financial losses, penalties, or damage to reputation

  • Experienced or predicted failures drive evolution

16

slide-46
SLIDE 46

A relevant case: multi-owner systems

  • Rely on third-party components to provide their own service, which

make environment volatile

  • Platform as a Service (cloud)
  • Software as a Service
  • Reinvigorating Leslie Lamport's statement
  • a distributed system is a system where I can't get my work done

because a computer has failed that I never heard of

17

slide-47
SLIDE 47

How can changes be handled?

  • Evolution due to environment changes is called

adaptation

  • Evolution and adaptation are traditionally performed off-

line, but they are increasingly performed on-line at run time (see continuously running systems)

  • Adaptation can be self-managed (self-adaptive systems)

18

  • J. Kephart, D. Chess, The vision of autonomic computing. IEEE Comput. 2003
  • R. de Lemos et al., Software engineering for self-adaptive systems. Dagstuhl Seminar 2009
  • E. Di Nitto et al., A journey to highly dynamic, self-adaptive service-based applications. ASE Journal, 2008
  • Software Engineering for Adaptive and Self-Managing Systems (SEAMS), starting 2006
slide-48
SLIDE 48

A personal journey through dependable self- adaptation and on-line evolution with the SMScom ERC AdG (2008-2013)

19

slide-49
SLIDE 49

The autonomic feedback loop

20

slide-50
SLIDE 50

The autonomic feedback loop

20

slide-51
SLIDE 51

The autonomic feedback loop

20

Where are the founding principles?

slide-52
SLIDE 52

Paradigm shift

  • SaSs ask for a paradigm shift, which involves both

development time (DT) and run time (RT)

  • The boundary between DT and RT fades
  • Reasoning and reacting capabilities must enrich the RT

environment

  • detect change
  • reason about the consequences of change
  • react to change

21

slide-53
SLIDE 53

Our view of the lifecycle

22

slide-54
SLIDE 54

Our view of the lifecycle

22

Reqs

slide-55
SLIDE 55

Our view of the lifecycle

22

Reqs Env

slide-56
SLIDE 56

Our view of the lifecycle

22

Reqs

Modelling Modelling Development time

Env

slide-57
SLIDE 57

Our view of the lifecycle

22

Reqs

Modelling Modelling Development time

Env

E 1

Machine+ environment

slide-58
SLIDE 58

Our view of the lifecycle

22

Reqs

Implementation Modelling Modelling Development time

Env

E 1

Machine+ environment

slide-59
SLIDE 59

Our view of the lifecycle

22

Reqs

Implementation Modelling Modelling Development time Run time

Env

E 1

Machine+ environment

slide-60
SLIDE 60

Our view of the lifecycle

22

Reqs

Implementation Execution Modelling Modelling Development time Run time

Env

E 1

Machine+ environment

slide-61
SLIDE 61

Our view of the lifecycle

22

Reqs

Implementation Monitoring Execution Modelling Modelling Development time Run time

Env

E 1

Machine+ environment

slide-62
SLIDE 62

Our view of the lifecycle

22

Reqs

Implementation Monitoring Execution Reasoning Modelling Modelling Development time Run time

Env

E 1

Machine+ environment

slide-63
SLIDE 63

Our view of the lifecycle

22

Reqs

Implementation Monitoring Execution Reasoning Modelling Modelling Development time Run time

Env

Self-adaptation

E 1

Machine+ environment

slide-64
SLIDE 64

Our view of the lifecycle

22

Reqs

Implementation Monitoring Execution Reasoning Modelling Modelling Development time Run time

Env

Self-adaptation

E 1

Machine+ environment

Offline adaptation

slide-65
SLIDE 65

Models&verification@run-time

  • To detect change, we need to monitor the environment
  • The changes must be retrofitted to models of the

machine+environment that support reasoning about the dependability argument (a learning step)

  • The updated models must be verified to check for

violations to the dependability argument

  • In case of a violation, a self-adaptation must be triggered

23

slide-66
SLIDE 66

Known unknowns vs unknown unknowns

  • The system can self-adapt to known unknowns
  • The unknowns are elicited at design time
  • The unknowns become known at run time via monitoring
  • If the system has been designed upfront to handle the now

knowns, it can self-adapt

  • If not, a designer must be in the loop
  • There are limits to automation: unknown unknowns cannot even be

monitored

24

Whereof one cannot speak, thereof one must be silent (Wittgenstein)

slide-67
SLIDE 67

25

Zooming in

slide-68
SLIDE 68

25

Zooming in

  • I. Epifani, C. Ghezzi, R. Mirandola, G. Tamburrelli, "Model Evolution by Run-

Time Parameter Adaptation”, ICSE 2009

  • C. Ghezzi, G. Tamburrelli, "Reasoning on Non Functional Requirements for

Integrated Services”, RE 2009

  • A. Filieri, C. Ghezzi, G. Tamburrelli, “ Run-time efficient probabilistic model

checking”, ICSE 2011

  • A. Filieri, C. Ghezzi, G. Tamburrelli, “Supporting Self-adaptation via

Quantitative Verification and Sensitivity Analysis at Run Time, IEEE TSE, January 2016

slide-69
SLIDE 69

An exemplary framework

  • QoS requirements
  • performance (response time), reliability (probability of

failure), cost (energy consumption)

User Integrated Service Workflow W Service S1 <uses> Service S2 <uses> Service Sn <uses> ....

26

slide-70
SLIDE 70

An exemplary framework

  • QoS requirements
  • performance (response time), reliability (probability of

failure), cost (energy consumption)

User Integrated Service Workflow W Service S1 <uses> Service S2 <uses> Service Sn <uses> ....

Sources of uncertainty (and change)

26

slide-71
SLIDE 71

Non-functional requirements are quantitative

  • Functional requirements are often qualitative ("the system shall close

the gate as the sensor signals an incoming train" or "it should never happen that the gate is open and the train is in the intersection")

  • Non-functional requirements refer to quality and they are often

quantitative ("average response time shall be less than 3 seconds");

  • ften they are probabilistic
  • LTL, CTL temporal logics are typical examples of qualitative

specification languages

  • Non-functional requirements ask for quantitative logics and

quantitative verification

27

slide-72
SLIDE 72

Formal modeling and analysis

  • S, E can often be formalized via probabilistic Markovian

models for non functional rquirements (reliability, performance, energy consumption)

  • R formalized via probabilistic temporal logic, e.g. PCTL
  • Verification performed via probabilistic model checking

28

slide-73
SLIDE 73

Brief intro to Discrete Time Markov Chains

29

A DTMC is defined by a tuple (S, s0, P , AP , L) where

  • S is a finite set of states
  • s0 ∈ S is the initial state
  • P: S×S→[0;1] is a stochastic matrix
  • AP is a set of atomic propositions
  • L: S→2AP is a labelling function.

The modelled process must satisfy the Markov property, i.e., the probability distribution

  • f future states does not depend on past states; the process is memoryless
slide-74
SLIDE 74

An#example#

!A simple communication protocol operating with a channel!

  • C. Baier, JP Katoen, “Principles of model checking” MIT Press, 2008

delivered try lost start

1 0.9 1 1 0.1

S D T L S 0 0 1 0 D 1 0 0 0 T 0 0.9 0 0.1 L 0 0 1 0

matrix representation

Note: sum of probabilities for transitions leaving a given state equals 1

30

slide-75
SLIDE 75

Discrete Time Markov Reward Models

  • Like a DTMC, plus
  • states/transitions labeled with a reward
  • rewards can be any real-valued, additive, non negative

measure; we use non-negative real functions

  • Use in modeling
  • rewards represent energy consumption, average

execution time, outsourcing costs, pay per use cost, CPU time

31

slide-76
SLIDE 76

Reward DTMC

  • A R-DTMC is a tuple (S, s0, P

, AP , L, µ), where S, s0, P , L are defined as for a DTMC, while µ is defined as follows:

  • µ : S→R≥0 is a state reward function assigning a non-

negative real number to each state

  • ... at step 0 the system enters the initial state s0.

At step 1, the system gains the reward µ(s0) associated with the state and moves to a new state...

32

slide-77
SLIDE 77

PCTL

  • Probabilistic extension of CTL
  • In a state, instead of existential and universal quantifiers over paths we

can predicate on the probability for the set of paths (leaving the state) that satisfy property

  • In addition, path formulas also include step-bounded until ϕ1 U

≤t

ϕ2

  • An example of a reachability property

P>0.8 [◊(system state = success)]

33

Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ

absorbing state

1

slide-78
SLIDE 78

R-PCTL

34

Reward-Probabilistic CTL for R-DTMC Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ | R

r (Θ)

Θ ::= I=k | C≤k | FΦ

slide-79
SLIDE 79

R-PCTL

34

Reward-Probabilistic CTL for R-DTMC Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ | R

r (Θ)

Θ ::= I=k | C≤k | FΦ R

r(I=k)

R

r(C≤k)

R

r(FΦ)

slide-80
SLIDE 80

R-PCTL

34

Reward-Probabilistic CTL for R-DTMC Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ | R

r (Θ)

Θ ::= I=k | C≤k | FΦ R

r(I=k)

R

r(C≤k)

R

r(FΦ)

true if expected state reward to be gained in the state entered at step k along the paths originating here meets the bound r

slide-81
SLIDE 81

R-PCTL

34

Reward-Probabilistic CTL for R-DTMC Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ | R

r (Θ)

Θ ::= I=k | C≤k | FΦ R

r(I=k)

R

r(C≤k)

R

r(FΦ)

slide-82
SLIDE 82

R-PCTL

34

Reward-Probabilistic CTL for R-DTMC Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ | R

r (Θ)

Θ ::= I=k | C≤k | FΦ R

r(I=k)

R

r(C≤k)

R

r(FΦ)

true if the expected reward cumulated after k steps meets the bound r

slide-83
SLIDE 83

R-PCTL

34

Reward-Probabilistic CTL for R-DTMC Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ | R

r (Θ)

Θ ::= I=k | C≤k | FΦ R

r(I=k)

R

r(C≤k)

R

r(FΦ)

slide-84
SLIDE 84

R-PCTL

34

Reward-Probabilistic CTL for R-DTMC Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ | R

r (Θ)

Θ ::= I=k | C≤k | FΦ R

r(I=k)

R

r(C≤k)

R

r(FΦ)

true if the expected reward cumulated before a state satisfying ϕ is reached meets the bound r

slide-85
SLIDE 85

R-PCTL

34

Reward-Probabilistic CTL for R-DTMC Φ ::= true | a | Φ ∧ Φ | ¬ Φ | P

p (Ψ)

Ψ ::= X Φ | Φ U Φ | Φ U≤t Φ | R

r (Θ)

Θ ::= I=k | C≤k | FΦ R

r(I=k)

R

r(C≤k)

R

r(FΦ)

slide-86
SLIDE 86

Example 1

Expected state reward to be gained in the state entered at step k along the paths originating in the given state

35

R

r(I=k)

slide-87
SLIDE 87

Example 1

Expected state reward to be gained in the state entered at step k along the paths originating in the given state

35

R

r(I=k)

“The expected cost gained after exactly 10 time steps is less than 5”

slide-88
SLIDE 88

Example 1

Expected state reward to be gained in the state entered at step k along the paths originating in the given state

35

R

r(I=k)

“The expected cost gained after exactly 10 time steps is less than 5”

R<5(I=10)

slide-89
SLIDE 89

Example 2

Expected cumulated reward within k time steps

36

R

r(C≤k)

“The expected energy consumption within the first 50 time units of operation is less than 6 kwh”

slide-90
SLIDE 90

Example 2

Expected cumulated reward within k time steps

36

R

r(C≤k)

“The expected energy consumption within the first 50 time units of operation is less than 6 kwh”

R<6(C≤50)

slide-91
SLIDE 91

Example 3

Expected cumulated reward until a state satisfying ϕ is reached

37

R

r(FΦ)

“The average execution time until a user session is complete is lower than 150 s”

slide-92
SLIDE 92

Example 3

Expected cumulated reward until a state satisfying ϕ is reached

37

R

r(FΦ)

“The average execution time until a user session is complete is lower than 150 s”

R<150(F end)

slide-93
SLIDE 93

A bit of theory

  • Probability for a finite path to be traversed

is 1 if otherwise

  • A state sj is reachable from state si if a finite path exists

leading to sj from si

  • The probability of moving from si to sj in exactly 2 steps

is which is the entry of

  • The probability of moving from si to sj in exactly k steps is the

entry of

38

π = s0, s1, s2, . . . |π| = 1 Q|π|−2

k=0 P(sk, sk+1)

P

sx∈S pix · pxj

(i, j) P 2 (i, j) P k

slide-94
SLIDE 94

A bit of theory

  • A state is recurrent if the probability that it will be eventually visited

again after being reached is 1; it is otherwise transient (a non-zero probability that it will never be visited again)

  • A recurrent state sk where pk, k = 1 is called absorbing
  • Here we assume DTMCs to be well-formed, i.e.
  • every recurrent state is absorbing
  • all states are reachable from initial state
  • from every transient state it is possible to reach an absorbing

state

39

slide-95
SLIDE 95

An example

40

1 2 3 1 0.2 0.5 0.3

slide-96
SLIDE 96

An example

40

    1 0.2 0.5 0.3 1 1     1 2 3 1 0.2 0.5 0.3

slide-97
SLIDE 97

An example

40

    1 0.2 0.5 0.3 1 1     1 2 3 1 0.2 0.5 0.3

Probability of reaching an absorbing state (e.g., 2) 2 can be reached by reaching 1 in 0, 1, 2,...∞ steps and then 2 with prob .5 (1+0.2+0.22+0.23+ ... ) x 0.5 = ( ∑ 0.2n) x 0.5 = (1/(1-0.2)) x 0.5 = 0.625 Similarly, for state 3, (1/(1-0.2)) x 0.3 = 0.375 Notice that an absorbing state is reached with prob 1

slide-98
SLIDE 98

A bit of theory

41

Qk → 0 as k → ∞

  • Consider a DTMC with r absorbing and t transient states
  • Its matrix can be restructured as
  • Q is a nonzero t × t matrix
  • R is a t × r matrix
  • 0 is a r × t matrix
  • I is a r × r identity matrix
  • Theorem
  • In a well-formed Markov chain, the probability of the process to

be eventually absorbed is 1

P = ✓ Q R I ◆ (1)

slide-99
SLIDE 99

Reachability properties

42

  • A reachability property has the following form

states that the probability of reaching a state where holds matches the constraint

  • Typically, they refer to reaching an absorbing state

(denoting success/failure for reliability analysis)

  • It is a flat formula (i.e. no subformula contains )
  • These properties are the most commonly found

P.

/p(♦ φ)

P.

/p(·)

slide-100
SLIDE 100

A bit on theory

43

Consider again ni,k expected # of visits of transient state sk from si, i.e., the sum of the probabilities of visiting it 0, 1, 2, ...times Theorem: The geometric series converges to Consider . The probability of reaching absorbing state sk from si is

P = ✓ Q R I ◆ (1) N = I + Q1 + Q2 + Q3 + · · · =

X

k=0

Qk (I − Q)−1 B = N × R bik = X

k=0..t−1

nij · rjk

j

slide-101
SLIDE 101

Proving reachability

44

) Pr( End s = ◊

⋅ =

j End j j r

n

, ,

n0,j is the sum of the probabilities to reach state j in 1, 2, 3, ... ∞ steps

slide-102
SLIDE 102

Model checking

  • SPIN (Holzmann) analyzes LTL properties for LTSs

expressed in Promela

  • (Nu)SMV (Clarke et al, Cimatti et al.) can also analyze CTL

properties and uses a symbolic representation of visited states (BDDs) to address the “state explosion problem”

  • PRISM (Kwiatkowska et al.) and MRMC (Katoen et al.)

support Markov models and perform probabilistic model checking

45

slide-103
SLIDE 103

Question

  • How can modeling notations and verification fit software

evolution?

  • Obvious solution:
  • A modification to an existing system viewed as a new

system

  • No support to reasoning on the changes and their

effects

46

slide-104
SLIDE 104

An e-commerce case study

47

Login Search Buy [buy more] NrmShipping ExpShipping [proceed] [normal] CheckOut Logout [express]

slide-105
SLIDE 105

An e-commerce case study

47

Login Search Buy [buy more] NrmShipping ExpShipping [proceed] [normal] CheckOut Logout [express]

Returning customers vs new customers

slide-106
SLIDE 106

An e-commerce case study

47

3 probabilistic requirements: R1: “Probability of success is > 0.8” R2: “Probability of a ExpShipping failure for a user recognized as ReturningCustomer < 0.035” R3: “Probability of an authentication failure is less then < 0.06”

Login Search Buy [buy more] NrmShipping ExpShipping [proceed] [normal] CheckOut Logout [express]

Returning customers vs new customers

slide-107
SLIDE 107

Assumptions

User profile assumptions External service assumptions (reliability)

RC RC RC NC NC

48

slide-108
SLIDE 108

1

2

Logged

9

Buy

6

Search

1

Returning

3

NewCustomer

7

Buy

4

Search

11 10

ExpShipping

12 14

Logout

16

Success

5

1 FailedLg

8

FailedChk

15

1 FailedNrmSh

13

1 FailedExpSh

1

Login 0.97 0.03 0.65 0.35 1

1 0.2 0.5 0.05 0.6

NrmShipping

0.03 0.95 0.1 0.97 0.95 0.9 1 0.15

1

0.3 0.05

CheckOut

0.25

S, E, R in practice

49

slide-109
SLIDE 109

1

2

Logged

9

Buy

6

Search

1

Returning

3

NewCustomer

7

Buy

4

Search

11 10

ExpShipping

12 14

Logout

16

Success

5

1 FailedLg

8

FailedChk

15

1 FailedNrmSh

13

1 FailedExpSh

1

Login 0.97 0.03 0.65 0.35 1

1 0.2 0.5 0.05 0.6

NrmShipping

0.03 0.95 0.1 0.97 0.95 0.9 1 0.15

1

0.3 0.05

CheckOut

0.25

R1: Probability of success > 0.8 R2: Probability of ExpShipping failure for ReturningCustomer < 0.035

S, E, R in practice

49

slide-110
SLIDE 110

What happens at run time?

  • Actual environment behavior is monitored
  • Model updated
  • e.g., by using a Bayesian approach to estimate

DTMC matrix (posterior) given run time traces and prior transitions

50

slide-111
SLIDE 111

What happens at run time?

  • Actual environment behavior is monitored
  • Model updated
  • e.g., by using a Bayesian approach to estimate

DTMC matrix (posterior) given run time traces and prior transitions

50

slide-112
SLIDE 112

What happens at run time?

  • Actual environment behavior is monitored
  • Model updated
  • e.g., by using a Bayesian approach to estimate

DTMC matrix (posterior) given run time traces and prior transitions

50

A-priori Knowledge

slide-113
SLIDE 113

What happens at run time?

  • Actual environment behavior is monitored
  • Model updated
  • e.g., by using a Bayesian approach to estimate

DTMC matrix (posterior) given run time traces and prior transitions

50

A-priori Knowledge A-posteriori Knowledge

slide-114
SLIDE 114

Verification @ runtime as a trigger for adaptation

  • The model has a predictive nature
  • Requirements violation on model predicts future

violations

  • This may lead to preventive adaptation prior to violations
  • Otherwise it leads to self-healing adaptation

51

slide-115
SLIDE 115

52

1

2

Logged

9

Buy

6

Search

1

Returning

3

NewCustomer

7

Buy

4

Search

11 10

ExpShipping

12 14

Logout

16

Success

5

1 FailedLg

8

FailedChk

15

1 FailedNrmSh

13

1 FailedExpSh

1

Login 0.97 0.03 0.65 0.35 1

1 0.2 0.5 0.05 0.6

NrmShipping

0.03 0.95 0.1 0.97 0.95 0.9 1 0.15

1

0.3 0.05

CheckOut

0.25

slide-116
SLIDE 116

52

1

2

Logged

9

Buy

6

Search

1

Returning

3

NewCustomer

7

Buy

4

Search

11 10

ExpShipping

12 14

Logout

16

Success

5

1 FailedLg

8

FailedChk

15

1 FailedNrmSh

13

1 FailedExpSh

1

Login 0.97 0.03 0.65 0.35 1

1 0.2 0.5 0.05 0.6

NrmShipping

0.03 0.95 0.1 0.97 0.95 0.9 1 0.15

1

0.3 0.05

CheckOut

0.25

slide-117
SLIDE 117

Models&Verification @ runtime: challenges

  • Paradigm change
  • The development-time / run-time boundary fades
  • Real-time constraints prevent applicability of current

techniques

53

slide-118
SLIDE 118

Towards efficient verification @ runtime

Make verification incremental

  • Instead of checking the model after any change, just

try to restrict the check to what has changed

  • easier to say than do!

54

slide-119
SLIDE 119

The quest for incrementality

  • Is a fundamental engineering principle

Given a system (model) S, and a set of properties P met by S Change = new pair S’, P’ where S’= S + ∆S and P’= P + ∆P Let ∏ be the proof of S against P The proof ∏’ of P’ against S’ can be done by just performing a proof increment ∆∏ such that ∏’ = ∏ + ∆∏ Expectation: ∆∏ easy and efficient to perform

55

slide-120
SLIDE 120

How can we achieve it?

  • By construction and change anticipation
  • leveraging modularity and encapsulation
  • assume/guarantee
  • By automatic scope detection

56

slide-121
SLIDE 121

An effective technique: incrementality by parameterization

  • Requires anticipation of changing parameters, represented

as symbolic variable

  • The model is partly numeric and partly symbolic
  • Evaluation of the verification condition requires partial

evaluation (mixed numerical/symbolic processing)

  • Result is a formula (polynomial for reachability on DTMCs)
  • Evaluation at run time substitutes actual values to symbolic

parameters and is very efficient

57

slide-122
SLIDE 122

An effective technique: incrementality by parameterization

  • Requires anticipation of changing parameters, represented

as symbolic variable

  • The model is partly numeric and partly symbolic
  • Evaluation of the verification condition requires partial

evaluation (mixed numerical/symbolic processing)

  • Result is a formula (polynomial for reachability on DTMCs)
  • Evaluation at run time substitutes actual values to symbolic

parameters and is very efficient

57

Working mom paradigm Cook first Warm-up later

slide-123
SLIDE 123

The parametric WM approach

58

slide-124
SLIDE 124

The parametric WM approach

58

Design-Time (offline) Partial evaluation

E 1

slide-125
SLIDE 125

The parametric WM approach

58

Run-Time (online) Design-Time (offline) Partial evaluation

E 1

slide-126
SLIDE 126

The parametric WM approach

58

Run-Time (online) Design-Time (offline) Partial evaluation

E 1

Parameter values

slide-127
SLIDE 127

The approach

  • Assumes that the Markov model is well formed
  • Works by symbolic/numeric matrix manipulation
  • All of (R) PCTL covered
  • Does partial evaluation (mixed computation, Ershov 1977)
  • Expensive design-time partial evaluation, fast run-time

verification

  • symbolic matrix multiplications, but very sparse and

normally only few variables

59

slide-128
SLIDE 128

An example

60

r = 0.85− 0.85⋅ x + 0.15⋅ z − 0.15⋅ x⋅ z − y⋅ x 0.85+ 0.15⋅ z

r = Pr(◊s = 5) > r

Additional benefit: sensitivity analysis

slide-129
SLIDE 129

Back to theory: flat reachability formula

61

We need to evaluate

where B = N x R; N is the inverse of I - Q,

ni,k expected # of visits of transient state sk from si, i.e., the sum of the probabilities of visiting it 0, 1, 2, ...times Matrix R is available, we need to compute N In our context, N must be evaluated partially, i.e., by a mix of numeric and symbolic processing

P = ✓ Q R I ◆ N = I + Q1 + Q2 + Q3 + · · · =

X

k=0

Qk Pr(true U {sj ∈ T}) = X

sj∈T

b0j

slide-130
SLIDE 130

Design-time vs run-time costs

  • Design-time computation expensive because of numeric/symbolic

computations

  • Complexity reduced by
  • sparsity
  • few symbolic transitions
  • careful management of symbolic/numeric parts
  • parallel processing
  • Run-time computation extremely efficient: polynomial formula for reachability,

minor additional complications for full R-PCTL coverage (but still very efficient!)

62

slide-131
SLIDE 131

Run-time performance comparison

63

PRISM MRMC WM Time (ms) 1 10 100 1000 System size (# of states) 50 100 150 200 250 300 350 400 450 500

128 randomly generated DTMCs, 50 to 500 states (with step 50), two absorbing states, and a normally distributed number of outgoing transitions per state with mean 10 and standard deviation 2. The number

  • f variable states is 4 in each model, thus the number of parameters of each model is normally distributed

with mean 40 and standard deviation 8.

slide-132
SLIDE 132

64

Looking forward

slide-133
SLIDE 133

Where are we?

65

slide-134
SLIDE 134

Where are we?

  • Change is quintessential to software
  • not a nuisance nor something to handle as an afterthought
  • Formal methods can set change management on systematic

and rigorous grounds that lead to effective and efficient evolution

  • They can be brought to runtime to self-manage response to

environment changes

65

slide-135
SLIDE 135

Where are we?

  • Change is quintessential to software
  • not a nuisance nor something to handle as an afterthought
  • Formal methods can set change management on systematic

and rigorous grounds that lead to effective and efficient evolution

  • They can be brought to runtime to self-manage response to

environment changes

  • How can they support a holistic response to changes

throughout the software lifetime?

65

slide-136
SLIDE 136

Looking forward: continuous assurance

66

slide-137
SLIDE 137

Looking forward: continuous assurance

  • Change of perspective: DevOps—the current hype
  • Development and operation viewed as a continuum
  • Focus on assurance that system complies with

requirements drives both development and operation

66

slide-138
SLIDE 138

Looking forward: continuous assurance

  • Change of perspective: DevOps—the current hype
  • Development and operation viewed as a continuum
  • Focus on assurance that system complies with

requirements drives both development and operation

  • Focus on continuous assurance requires revisiting

verification methods in the light of continuous change

66

slide-139
SLIDE 139

Looking forward

  • Software development has become increasingly

incremental, change-oriented, agile

67

  • B. Meyer, "Agile! The good, the Hype and the Ugly”, Springer, 2015
slide-140
SLIDE 140

Looking forward

  • Software development has become increasingly

incremental, change-oriented, agile

67

  • B. Meyer, "Agile! The good, the Hype and the Ugly”, Springer, 2015
  • The ugly
  • deprecation of upfront activities: requirements

(replaced by user stories), specification (replaced by tests), modeling…

slide-141
SLIDE 141

Looking forward

  • Software development has become increasingly

incremental, change-oriented, agile

67

  • B. Meyer, "Agile! The good, the Hype and the Ugly”, Springer, 2015
slide-142
SLIDE 142

Looking forward

  • Software development has become increasingly

incremental, change-oriented, agile

67

  • B. Meyer, "Agile! The good, the Hype and the Ugly”, Springer, 2015
  • The good
  • continuous testing: do not wait for a complete

system…

slide-143
SLIDE 143

Looking forward

  • Software development has become increasingly

incremental, change-oriented, agile

67

  • B. Meyer, "Agile! The good, the Hype and the Ugly”, Springer, 2015
slide-144
SLIDE 144

Looking forward

  • Software development has become increasingly

incremental, change-oriented, agile

67

  • B. Meyer, "Agile! The good, the Hype and the Ugly”, Springer, 2015
  • Get rid of the ugly and move the good one

step further

  • automate upfront activities and integrate

them in agile development

  • can we achieve verification driven

development in practice?

slide-145
SLIDE 145

What needs to be done

68

slide-146
SLIDE 146

What needs to be done

  • How can we integrate modelling and verification into iterative,

agile development?

68

slide-147
SLIDE 147

What needs to be done

  • How can we integrate modelling and verification into iterative,

agile development?

  • Support incomplete, partial specifications

68

  • G. Bruns, P. Godefroid. Model checking partial state spaces with 3-valued temporal logics. In

Computer Aided Verification, vol. 1633 LNCS, Springer, 1999.

  • G. Bruns, P. Godefroid. Generalized model checking: Reasoning about partial state spaces.

CONCUR 2000

  • M. Chechik, B. Devereux, S. Easterbrook, A. Gurfinkel. Multi-valued symbolic model-
  • checking. ACM TOSEM, 2003.
  • S. Uchitel, G. Brunet, M. Chechik. Synthesis of partial behavior models from properties and
  • scenarios. IEEE TSE 2009.
  • G. Brunet, M. Chechik, D. Fischbein, N. D’Ippolito, S. Uchitel,Weak alphabet merging of

partial behaviour models. ACM TOSEM 2011.

slide-148
SLIDE 148

What needs to be done

  • How can we integrate modelling and verification into iterative,

agile development?

  • Support incomplete, partial specifications
  • Support reasoning about changes: support incremental

verification

68

  • G. Bruns, P. Godefroid. Model checking partial state spaces with 3-valued temporal logics. In

Computer Aided Verification, vol. 1633 LNCS, Springer, 1999.

  • G. Bruns, P. Godefroid. Generalized model checking: Reasoning about partial state spaces.

CONCUR 2000

  • M. Chechik, B. Devereux, S. Easterbrook, A. Gurfinkel. Multi-valued symbolic model-
  • checking. ACM TOSEM, 2003.
  • S. Uchitel, G. Brunet, M. Chechik. Synthesis of partial behavior models from properties and
  • scenarios. IEEE TSE 2009.
  • G. Brunet, M. Chechik, D. Fischbein, N. D’Ippolito, S. Uchitel,Weak alphabet merging of

partial behaviour models. ACM TOSEM 2011.

slide-149
SLIDE 149

Support to incomplete, partial specifications

  • Given an incomplete system (model) S, and a set of

properties P to be met by S

  • Verification can return YES, NO, MAYBE
  • In the MAYBE case, it should compute proof
  • bligations for the incomplete parts
  • Completion only verifies proof obligations

69

slide-150
SLIDE 150

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

slide-151
SLIDE 151

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

?

E(¬( ) )U( )

slide-152
SLIDE 152

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

?

E(¬( ) )U( )

slide-153
SLIDE 153

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

E(¬( ) )U( )

slide-154
SLIDE 154

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

E(¬( ) )U( )

?

slide-155
SLIDE 155

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

E(¬( ) )U( )

?

slide-156
SLIDE 156

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

E(¬( ) )U( )

slide-157
SLIDE 157

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

E(¬( ) )U( )

?

slide-158
SLIDE 158

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

E(¬( ) )U( )

?

MAYBE and this: "blah blah" is the proof obligation

slide-159
SLIDE 159

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

E(¬( ) )U( )

?

MAYBE and this: "blah blah" is the proof obligation

slide-160
SLIDE 160

Example of an incomplete model

  • An FSM where certain states stand for an unspecified FSM
  • a functionality whose detail model is postponed

70

E(¬( ) )U( )

?

MAYBE and this: "blah blah" is the proof obligation

slide-161
SLIDE 161

Partial models vs. incremental changes

  • Initial decomposition affects the kind of incrementally we

get

  • Can we achieve incremental verification independent of

hierarchical decomposition?

  • Can a general approach to incremental verification be

found independent of model/program and property language to verify?

71

slide-162
SLIDE 162

Towards a general theory of incremental verification

72

  • D. Bianculli, A. Filieri, C. Ghezzi, and D. Mandrioli, Syntactic-Semantic Incrementality for

Agile Verification, Science of Computer Programming 2014

slide-163
SLIDE 163

Syntactic-semantic incremental verification

  • A general approach
  • independent of the artifact
  • model, program, ....
  • independent of the property language
  • LTL, CTL, PCTL, Hoare logic, Matching Logic, ...
  • unconstrained possible changes in artifact (and in

property)

73

slide-164
SLIDE 164

Intuition: back to the 1970's

  • Incremental parsing: Re-build the minimum sub-tree

“covering” the change w, rooted in <N>, and “plug-it-in” the unmodified portion of tree

74

  • C. Ghezzi and D. Mandrioli, Incremental parsing, ACM TOPLAS, 1979
  • C. Ghezzi and D. Mandrioli, Augmenting Parsers to Support Incrementality. J. ACM, 1980

hSi hN i xwz

slide-165
SLIDE 165

Example

  • Incremental parsing can detect the part of the syntax tree

to rebuild and hook it into the unchanged part 6*5+3*2+1 6*5+4+1

75

slide-166
SLIDE 166

Example

  • Incremental parsing can detect the part of the syntax tree

to rebuild and hook it into the unchanged part 6*5+3*2+1 6*5+4+1

75

slide-167
SLIDE 167

Example

  • Incremental parsing can detect the part of the syntax tree

to rebuild and hook it into the unchanged part 6*5+3*2+1 6*5+4+1

75

slide-168
SLIDE 168

Intuition: adding semantics

76

slide-169
SLIDE 169

Intuition: adding semantics

  • Semantic functions can be attached to syntactic rules

and computed traversing the syntax tree (Knuth's attribute grammars)

  • The formalism is Turing complete
  • Attributes can be evaluated by bottom-up traversal

76

slide-170
SLIDE 170

Intuition: adding semantics

  • Semantic functions can be attached to syntactic rules

and computed traversing the syntax tree (Knuth's attribute grammars)

  • The formalism is Turing complete
  • Attributes can be evaluated by bottom-up traversal
  • Any verification algorithm can be expressed via

attribute functions

76

slide-171
SLIDE 171

Current stage

  • Using the approach in significant case studies
  • Incremental reliability analysis of Web service

compositions

  • Complete semantics of Kernel C and verification of

Matching Logic properties

  • Building a syntactic-semantic incremental engine

77

  • D. Bianculli, A. Filieri, C. Ghezzi, and D. Mandrioli, Incremental Syntactic-Semantic

Reliability Analysis of Evolving Structured Workflows, ISOLA 2014

slide-172
SLIDE 172

78

Dynamic software update

  • X. Ma, L. Baresi, C. Ghezzi, V. Panzica La Manna, and J. Lu, Version-consistent dynamic

reconfiguration of component-based distributed systems, in Proceedings of ESEC/FSE ’11

  • L. Baresi, C. Ghezzi, X. Ma, and V. Panzica La Manna Efficient Dynamic Updates of

Distributed Components, to appear on IEEE TSE

slide-173
SLIDE 173

The problem

  • You have an existing and running distributed application
  • You identify changes that need to be made as a

reconfiguration (i.e., an update of a distributed configuration)

  • Assumptions
  • Componentized distributed implementation
  • Reconfiguration affects a small number of components

79

slide-174
SLIDE 174

Traditional solution

  • Develop updates and verify their correctness off-line
  • Shut down running system
  • Deploy new components and restart updated system

80

slide-175
SLIDE 175

Requirements for dynamic update

  • Dynamic update must be
  • safe: new offline version must be correct and ongoing

activities must complete correctly)

  • have low disruption (i.e., interruption of system service)
  • timely: delay of update is minimal

81

slide-176
SLIDE 176

A simple case study

82

Proc Portal DB Auth

Ditributed components and their static dependencies

slide-177
SLIDE 177

Transactions

  • A transaction is a sequence of actions executed by a component that completes in

bounded time

  • Actions include:
  • Local computations
  • Message exchanges
  • A transaction can be:
  • a root transaction if initiated by an outside client
  • a sub-transaction if initiated by another transaction
  • A distributed transaction includes the root transaction and all (direct and indirect)

sub-transactions

83

slide-178
SLIDE 178

Transactions

84

Auth Auth Portal Portal Proc Proc DBAccess DBAccess

T0 T0 T1 T1 T3 T3 T2 T2 T4 T4 getToken (cred) return token process (token,data) verify(token)

  • k

dbOperation() db result proc result

root$transaction$ $ sub,transaction$ $

Extended set of a transaction T is set comprising T and all its direct and indirect subtransactions

slide-179
SLIDE 179

Idleness

  • A component (node) is idle if it is not engaged in a

transaction

  • It is a necessary condition for component update (for

simplicity, we assume components to be stateless; i.e., dynamic update does not require application of a state transfer function)

  • Idleness is not a sufficient condition; additional conditions

must also be considered

85

slide-180
SLIDE 180

Replacing Auth when idle

86

Portal

T0

Auth Proc DB

T1 getToken(cred) return token T2 process(token, data) T3 verify(token) OK T4 dbOp()

B

slide-181
SLIDE 181

Replacing Auth when idle

86

Portal

T0

Auth Proc DB

T1 getToken(cred) return token T2 process(token, data) T3 verify(token) OK T4 dbOp()

A

D

C

slide-182
SLIDE 182

Replacing Auth when idle

86

Portal

T0

Auth Proc DB

T1 getToken(cred) return token T2 process(token, data) T3 verify(token) OK T4 dbOp()

C

slide-183
SLIDE 183

87

Quiescence (Kramer&Magee, TSE 1990)

A sufficient condition: all transactions initiated by dependent nodes must be completed

slide-184
SLIDE 184

87

Progress of nodes that may (indirectly) activate Auth must also be blocked

Portal

T0

Auth Proc DB

T1

getToken(cred) return token

T2

process(token, data) T3 verify(token)

OK

T4

dbOp()

A C D

✖ ✖ ✖

Quiescence (Kramer&Magee, TSE 1990)

A sufficient condition: all transactions initiated by dependent nodes must be completed

slide-185
SLIDE 185

Tranquillity (Vandewoude et al. TSE 2007)

  • Aims at reducing disruption caused by quiescence
  • no need to wait for a transaction to complete if it will

not request service of the node to be updated (even if it has been involved in the transaction in the past)

  • also possible to update a node if an on-going

transaction will request service but they have not before

88

slide-186
SLIDE 186

Tranquillity can be unsafe

89

Portal

T0

Auth Proc DB

T1 getToken(cred) return token T2 process(token, data) T3 verify(token) OK T4 dbOp()

slide-187
SLIDE 187

Tranquillity can be unsafe

89

Portal

T0

Auth Proc DB

T1 getToken(cred) return token T2 process(token, data) T3 verify(token) OK T4 dbOp()

A

slide-188
SLIDE 188

Tranquillity can be unsafe

89

Portal

T0

Auth Proc DB

T1 getToken(cred) return token T2 process(token, data) T3 verify(token) OK T4 dbOp()

A

D

slide-189
SLIDE 189

Tranquillity can be unsafe

89

Portal

T0

Auth Proc DB

T1 getToken(cred) return token T2 process(token, data) T3 verify(token) OK T4 dbOp()

A

C

D

It is a sufficient condition if "components follow the black-box principle" but how can this be established?

slide-190
SLIDE 190

Updates and version consistency

  • An update (ignoring state transfer) is a tuple <S, c, c'> , where S is a

configuration (set of components), c is a component and c' is its update

  • Correct update: assuming SP

, SP' to be the specs of S, S', — transactions that end before the update satisfy SP , — transactions that begin after the update satisfy SP', — those that begin before and end after the update satisfy either SP or SP'

  • Transaction T is version consistent with respect to update <S, c, c'> iff

no two transactions T1, T2 in ext(T) exist such that h(T1) = c and h(T2) = c'

  • A dynamic update is version consistent if c is idle and all transactions in the

system are version consistent

  • Version consistency ensures correct dynamic update

90

slide-191
SLIDE 191

How to check version consistency?

  • We proposed a distributed algorithm for checking version

consistency

  • The algorithm builds a dynamic, distributed data

structure representing dynamic dependencies

  • Each component has a local portion that supports a local

check of version consistency to enable its update

91

slide-192
SLIDE 192

Intuitively

  • For each node n, we record information p/T and f/T

indicating that some node has invoked in the past n in the context of a root transaction T, or will invoke it in the future

  • We say that a node is free if it is idle and has no pair p/T,

f/T for all root transactions T

  • A dynamic update is version consistent if it happens

when the node is free

92

slide-193
SLIDE 193

Intuitively

  • How can we achieve freeness?
  • Wait for it to happen
  • Concurrent versions (as soon as a version becomes

free, it is safely removed)

  • Blocking for freeness (requests to a node are

blocked to avoid creating a p/T if an f/T is present)

93

(details in L. Baresi, C. Ghezzi, X. Ma, and V. Panzica La Manna Efficient Dynamic Updates of Distributed Components, to appear on IEEE TSE)

slide-194
SLIDE 194

In summary

  • Version consistency requires more complex run-time

support actions

  • But experimental assessment shows that it achieves

better results (in terms of timeliness and disruption) than quiescence

94

slide-195
SLIDE 195

Conclusions

95

slide-196
SLIDE 196

Software evolution

  • It is a first-class citizen, cannot be handled as a patch
  • It must be anticipated and governed
  • It must not add flexibility at the expense of correctness
  • Formal methods play a fundamental role in founding both

the design time and the run time

96