– 9 – 2017-06-19 – main –
Softwaretechnik / Software-Engineering
Lecture 9: Live Sequence Charts
2017-06-19
- Prof. Dr. Andreas Podelski, Dr. Bernd Westphal
Albert-Ludwigs-Universität Freiburg, Germany
Lecture 9: Live Sequence Charts 2017-06-19 Prof. Dr. Andreas - - PowerPoint PPT Presentation
Softwaretechnik / Software-Engineering Lecture 9: Live Sequence Charts 2017-06-19 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universitt Freiburg, Germany 9 2017-06-19 main Topic Area Requirements
– 9 – 2017-06-19 – main –
2017-06-19
Albert-Ludwigs-Universität Freiburg, Germany
– 9 – 2017-06-19 – Sblockcontent –
2/54
VL 6 . . . VL 7 . . . VL 8 . . . VL 9 . . .
– 9 – 2017-06-19 – main –
3/54
– 9 – 2017-06-19 – Scontent –
4/54
– 9 – 2017-06-19 – Sformalre –
5/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
specify the allowed softwares that make the customer happy.
– 9 – 2017-06-19 – Sformalre –
5/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
specify the allowed softwares that make the customer happy.
between softwares and software specifications. That is, given a software S and a software specification S , we want to define when (and only when) software S satisfies software specification S , denoted by S | = S .
– 9 – 2017-06-19 – Sformalre –
5/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
specify the allowed softwares that make the customer happy.
between softwares and software specifications. That is, given a software S and a software specification S , we want to define when (and only when) software S satisfies software specification S , denoted by S | = S .
= S : specification is satisfied, S is one “allowed” design, should be accepted.
= S : specification is not satisfied, S may not satisfy customer’s needs.
– 9 – 2017-06-19 – Sformalre –
6/54
set S of (finite or infinite) computation paths of the form σ0
α1
− − → σ1
α2
− − → σ2 · · · where
The (possibly partial) function · : S → S is called interpretation of S.
– 9 – 2017-06-19 – Sformalre –
6/54
set S of (finite or infinite) computation paths of the form σ0
α1
− − → σ1
α2
− − → σ2 · · · where
The (possibly partial) function · : S → S is called interpretation of S.
S = {(S1, · 1), (S2, · 2), . . . }. The (possibly partial) function · : S → S is called interpretation of S .
– 9 – 2017-06-19 – Sformalre –
7/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
by S | = S , if and only if (S, · ) ∈ S .
– 9 – 2017-06-19 – Sformalre –
8/54
Software Specification S :
T: room ventilation r1 r2 r3 b button pressed? × × −
ventilation off? × − ∗
ventilation on? − × ∗ go start ventilation × − − stop stop ventilation − × −
Define: (S, · ) ∈ S if and only if for all σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S and for all i ∈ N0, ∃ r ∈ T • σi | = F(r).
– 9 – 2017-06-19 – Sformalre –
8/54
Software Specification S :
T: room ventilation r1 r2 r3 b button pressed? × × −
ventilation off? × − ∗
ventilation on? − × ∗ go start ventilation × − − stop stop ventilation − × −
Define: (S, · ) ∈ S if and only if for all σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S and for all i ∈ N0, ∃ r ∈ T • σi | = F(r).
Software
ventilation controller.
points in time the conditions b, off , on, go, stop when the software runs.
computation paths of the form σ0
τ
− → σ1
τ
− → σ2 · · · where each σi is a valuation of b, off , on, go, stop, i.e. σi : {b, off , on, go, stop} → B.
– 9 – 2017-06-19 – Sformalre –
8/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Software Specification S :
T: room ventilation r1 r2 r3 b button pressed? × × −
ventilation off? × − ∗
ventilation on? − × ∗ go start ventilation × − − stop stop ventilation − × −
Define: (S, · ) ∈ S if and only if for all σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S and for all i ∈ N0, ∃ r ∈ T • σi | = F(r).
Software
ventilation controller.
points in time the conditions b, off , on, go, stop when the software runs.
computation paths of the form σ0
τ
− → σ1
τ
− → σ2 · · · where each σi is a valuation of b, off , on, go, stop, i.e. σi : {b, off , on, go, stop} → B.
– 9 – 2017-06-19 – Sformalre –
8/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Software Specification S :
T: room ventilation r1 r2 r3 b button pressed? × × −
ventilation off? × − ∗
ventilation on? − × ∗ go start ventilation × − − stop stop ventilation − × −
Define: (S, · ) ∈ S if and only if for all σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S and for all i ∈ N0, ∃ r ∈ T • σi | = F(r).
Software
ventilation controller.
points in time the conditions b, off , on, go, stop when the software runs.
computation paths of the form σ0
τ
− → σ1
τ
− → σ2 · · · where each σi is a valuation of b, off , on, go, stop, i.e. σi : {b, off , on, go, stop} → B.
τ
− → σ1 · · · ∈ S with
σ1 = {b → 0, off → 1, on → 0, go → 1, stop → 0}.
– 9 – 2017-06-19 – Sformalre –
9/54
σ0 α0
1
− − → σ0
1
α0
2
− − → σ0
2 · · ·
S = {(S0, · 0)}
– 9 – 2017-06-19 – Sformalre –
9/54
σ0 α0
1
− − → σ0
1
α0
2
− − → σ0
2 · · ·
S = {(S0, · 0)}
σ1 α1
1
− − → σ1
1
α1
2
− − → σ1
2 · · ·
(S1, · 1)}
– 9 – 2017-06-19 – Sformalre –
9/54
σ0 α0
1
− − → σ0
1
α0
2
− − → σ0
2 · · ·
S = {(S0, · 0)}
σ1 α1
1
− − → σ1
1
α1
2
− − → σ1
2 · · ·
(S1, · 1)} I M
S1 implements S via I and M
– 9 – 2017-06-19 – Sformalre –
9/54
σ0 α0
1
− − → σ0
1
α0
2
− − → σ0
2 · · ·
S = {(S0, · 0)}
σ1 α1
1
− − → σ1
1
α1
2
− − → σ1
2 · · ·
(S1, · 1)}
σ2 α2
1
− − → σ2
1
α2
2
− − → σ2
2 · · ·
(S2, · 2)} I M
S1 implements S via I and M
I′ M ′
S2 implements S via I and M
– 9 – 2017-06-19 – Sformalre –
10/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Software Specification
S :
Define: (S, · ) ∈ S if and only if
corresponding σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S,
corresponding σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S,
if some σi satisfies the pre-condition, then σi
αi+1
− − − − → σi+1
αi+2
− − − − → · · · corresponds to the use case.
– 9 – 2017-06-19 – Sformalre –
10/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Software Specification
S :
Define: (S, · ) ∈ S if and only if
corresponding σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S,
corresponding σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S,
if some σi satisfies the pre-condition, then σi
αi+1
− − − − → σi+1
αi+2
− − − − → · · · corresponds to the use case.
Software
points in time the observables relevant for the use cases when the software S runs.
as computation paths where each state σi is a valuation of the use case’s observables.
– 9 – 2017-06-19 – Sformalre –
11/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Software Specification
S :
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 p W A T E R water_in_stock dWATER OK
Define: (S, · ) ∈ S if and only if
– 9 – 2017-06-19 – Sformalre –
11/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Software Specification
S :
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 p W A T E R water_in_stock dWATER OK
Define: (S, · ) ∈ S if and only if
Software
points in time the observables relevant for the LSC (conditions and messages) when the soft- ware S runs.
as computation paths over the LSC’s observ- ables.
– 9 – 2017-06-19 – Scontent –
12/54
– 9 – 2017-06-19 – main –
13/54
– 9 – 2017-06-19 – Sprechart –
14/54
LSC: buy water AC: true AM: invariant I: strict
User CoinValidator ChoicePanel Dispenser C50 p W A T E R water_in_stock d W A T E R O K
A full LSC L = (PC, MC, ac0, am, ΘL ) actually consist of
– 9 – 2017-06-19 – Sprechart –
15/54
– 8 – 2017-06-01 – Slscsyn –
32/46
L × L
I1 I2 c1 I3 A B C D E c2 c3 c4 l1,0 l1,1 l1,2 l1,3 l1,4 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1 l3,2 l3,3
l1,2 l1,4, l2,0 l2,1 l2,2 l2,3, l3,0 l3,1 l3,2 l3,3, l1,1 l2,1, l2,2 l1,2, l2,3 l1,3, l3,2 l1,4, l2,1 l3,1, l2,2 l3,2,
– 9 – 2017-06-19 – Sprechart –
16/54
ΘL am = initial am = invariant cold
∃ w ∈ W ∃ m ∈ N0 • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∃ w ∈ W ∃ k < m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
hot
∀ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∀ w ∈ W ∀ k ≤ m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
α1
− − → σ1
α2
− − → σ2 · · · ∈ S).
– 9 – 2017-06-19 – Sprechart –
17/54
(i) Insert one 1 euro coin. (ii) Press the ‘softdrink’ button. (iii) Get a softdrink.
(i) Insert one 50 cent and one 1 euro coin. (ii) Press the ‘softdrink’ button. (iii) Get a softdrink. (iv) Get 50 cent change.
(i) Insert one 1 euro coin. (ii) Press the ‘softdrink’ button. (iii) Do not insert any more money. (iv) Get two softdrinks.
– 9 – 2017-06-19 – Sprechart –
18/54
LSC: buy softdrink AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT
ΘL am = initial am = invariant cold
∃ w ∈ W ∃ m ∈ N0 • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∃ w ∈ W ∃ k < m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
hot
∀ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∀ w ∈ W ∀ k ≤ m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
– 9 – 2017-06-19 – Sprechart –
19/54
LSC: get change AC: true AM: invariant I: permissive
User
C50 E1 pSOFT SOFT chg-C50
ΘL am = initial am = invariant cold
∃ w ∈ W ∃ m ∈ N0 • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∃ w ∈ W ∃ k < m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
hot
∀ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∀ w ∈ W ∀ k ≤ m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
– 9 – 2017-06-19 – Sprechart –
20/54
LSC: buy water AC: true AM: invariant I: strict
User CoinValidator ChoicePanel Dispenser C50 p W A T E R water_in_stock dWATER OK
ΘL am = initial am = invariant cold
∃ w ∈ W ∃ m ∈ N0 • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∃ w ∈ W ∃ k < m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
hot
∀ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∀ w ∈ W ∀ k ≤ m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
– 9 – 2017-06-19 – Sprechart –
21/54
(i) Insert one 1 euro coin. (ii) Press the ‘softdrink’ button. (iii) Get a softdrink.
(i) Insert one 50 cent and one 1 euro coin. (ii) Press the ‘softdrink’ button. (iii) Get a softdrink. (iv) Get 50 cent change.
(i) Insert one 1 euro coin. (ii) Press the ‘softdrink’ button. (iii) Do not insert any more money. (iv) Get two softdrinks.
– 9 – 2017-06-19 – Sprechart –
22/54
LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
ΘL am = initial am = invariant cold
∃ w ∈ W ∃ m ∈ N0 • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∃ w ∈ W ∃ k < m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
hot (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
hot
∀ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, CP 0 )
∧ w/1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC)) ∀ w ∈ W ∀ k ≤ m ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, CP 0 )
∧ w/k + 1, . . . , w/m ∈ Lang(B(PC)) ∧ wm+1 | = ψCond
cold (∅, CM 0 )
= ⇒ wm+1 | = ψCond
cold (∅, CM 0 )
∧ w/m + 1 ∈ Lang(B(MC))
– 9 – 2017-06-19 – main –
23/54
– 9 – 2017-06-19 – Slsc –
24/54
I1 I2
φ
I3
E F G
concrete syntax
(diagram)
((L, , ∼), I, Msg, Cond, LocInv, Θ) abstract syntax
q1 q2 q3 q4 q5 q6 q7 true
semantics
(Büchi automaton)
– 9 – 2017-06-19 – main –
25/54
– 9 – 2017-06-19 – Slscsem –
26/54 “Only” construct the transitions’ labels:
→= {(q, ψloop(q), q) | q ∈ Q} ∪ {(q, ψprog(q, q′), q′) | q F q′} ∪ {(q, ψexit(q), L) | q ∈ Q}
q q1 ... qn
ψloop(q) =
=:ψhot loop (q)
hot
(q) ∧ψLocInv
cold
(q) ψexit(q) =
loop(q) ∧ ¬ψLocInv cold
(q)
1≤i≤n
prog(q, qi)
∧
cold
(q, qi)∨¬ψCond
cold (q, qi)
=:ψhot prog (q,qn)
hot (q, qn) ∧ ψLocInv,• hot
(q, qn) ∧ ψCond
cold (q, qn) ∧ ψLocInv,• cold
(q, qn) true
I1 I2 c1 I3 A B C D E c2 ∧ c3
– 9 – 2017-06-19 – Slscsem –
27/54
ψloop(q) = ψMsg(q) ∧ ψLocInv
hot
(q) ∧ ψLocInv
cold
(q)
1≤i≤n ψMsg(q, qi) ∧
⇒
¬ψ
θ
(q) =
ℓ=(l,ι,φ,l′,ι′)∈LocInv, Θ(ℓ)=θ, ℓ active at q φ
A location l is called front location of cut C if and only if ∄ l′ ∈ L • l ≺ l′. Local invariant (lo, ι0, φ, l1, ι1) is active at cut (!) q if and only if l0 l ≺ l1 for some front location l of cut q or l = l1 ∧ ι1 = •.
1≤i≤n Msg(Fi) I1 I2 c1 I3 A B C D E c2 ∧ c3
– 9 – 2017-06-19 – Slscsem –
28/54
ψhot
prog(q, qi) = ψMsg(q, qn) ∧ ψCond hot (q, qn) ∧ ψLocInv,• hot
(qn)
ψ∈Msg(qi\q) ψ ∧ j=i
∧
⇒
¬ψ
θ
(q, qi) =
γ=(L,φ)∈Cond, Θ(γ)=θ, L∩(qi\q)=∅ φ
θ
(q, qi) =
λ=(l,ι,φ,l′,ι′)∈LocInv, Θ(λ)=θ, λ •-active at qi φ
Local invariant (l0, ι0, φ, l1, ι1) is •-active at q if and only if
for some front location l of cut (!) q.
I1 I2 c1 I3 A B C D E c2 ∧ c3
– 9 – 2017-06-19 – Slscsem –
29/54
I1 I2
φ
I3
E F G
l1,0 l1,1 l1,2 l2,0 l2,1 l2,2 l2,3 l3,0 l3,1
q1 q2 q3 q4 q5 q6 q7
true
– 9 – 2017-06-19 – Scontent –
30/54
– 9 – 2017-06-19 – Sttwytt –
31/54
– 9 – 2017-06-19 – main –
32/54
– 9 – 2017-06-19 – Stba –
33/54
q1 q2 1 A: Σ = {0, 1} q1 q2 1 B: Σ = {0, 1} q1 q2 1 1 B′: Σ = {0, 1} q1 q2 even(x)
Asym: Σ = ({x} → N) q1 q2 even(x)
Bsym: Σ = ({x} → N)
Büchi infinite words symbolic symbolic Büchi infinite words
– 9 – 2017-06-19 – Stba –
34/54
B = (CB, Q, qini, →, QF ) where
Each transitions (q, ψ, q′) ∈ → from state q to state q′ is labelled with a formula ψ ∈ Φ(CB).
– 9 – 2017-06-19 – Stba –
35/54
w = σ1, σ2, σ3, · · · ∈ (Φ(CB) → B)ω an infinite word, each letter is a valuation of Φ(CB). An infinite sequence ̺ = q0, q1, q2, . . . ∈ Qω
= ψi. Example:
q1 q2 even(x)
Bsym: Σ = ({x} → N)
– 9 – 2017-06-19 – Stba –
36/54
Definition. We say TBA B = (CB, Q, qini, →, QF ) accepts the word w = (σi)i∈N0 ∈ (Φ(CB) → B)ω if and only if B has a run ̺ = (qi)i∈N0
fair (or accepting) states are visited infinitely often by ̺, i.e., such that ∀ i ∈ N0 ∃ j > i : qj ∈ QF . We call the set Lang(B) ⊆ (Φ(CB) → B)ω of words that are accepted by B the language of B. Example:
q1 q2 even(x)
Bsym: Σ = ({x} → N)
– 9 – 2017-06-19 – main –
37/54
– 9 – 2017-06-19 – Stestplay –
38/54
A software S is called compatible with LSC L over C and E is if and only if
– 9 – 2017-06-19 – Stestplay –
38/54
A software S is called compatible with LSC L over C and E is if and only if
A computation path π = σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S of software S induces the word w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . . , we use WS to denote the set of words induced by S.
– 9 – 2017-06-19 – Stestplay –
38/54
A software S is called compatible with LSC L over C and E is if and only if
A computation path π = σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S of software S induces the word w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . . , we use WS to denote the set of words induced by S.
We say software S satisfies LSC L (without pre-chart), denoted by S | = L , if and only if
– 9 – 2017-06-19 – Stestplay –
38/54
A software S is called compatible with LSC L over C and E is if and only if
A computation path π = σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S of software S induces the word w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . . , we use WS to denote the set of words induced by S.
We say software S satisfies LSC L (without pre-chart), denoted by S | = L , if and only if
ΘL am = initial am = invariant cold
∃ w ∈ WS • w0 | = ac ∧ ¬ψexit(C0) ∧ w0 | = ψprog(∅, C0) ∧ w/1 ∈ Lang(B(L )) ∃ w ∈ WS ∃ k ∈ N0 • wk | = ac ∧ ¬ψexit(C0) ∧ wk | = ψprog(∅, C0) ∧ w/k + 1 ∈ Lang(B(L ))
hot
∀ w ∈ WS • w0 | = ac ∧ ¬ψexit(C0) = ⇒ w0 | = ψprog(∅, C0) ∧ w/1 ∈ Lang(B(L )) ∀ w ∈ WS ∀ k ∈ N0 • wk | = ac ∧ ¬ψexit(C0) = ⇒ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
– 9 – 2017-06-19 – Stestplay –
38/54
A software S is called compatible with LSC L over C and E is if and only if
A computation path π = σ0
α1
− − → σ1
α2
− − → σ2 · · · ∈ S of software S induces the word w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . . , we use WS to denote the set of words induced by S.
We say software S satisfies LSC L (without pre-chart), denoted by S | = L , if and only if
ΘL am = initial am = invariant cold
∃ w ∈ WS • w0 | = ac ∧ ¬ψexit(C0) ∧ w0 | = ψprog(∅, C0) ∧ w/1 ∈ Lang(B(L )) ∃ w ∈ WS ∃ k ∈ N0 • wk | = ac ∧ ¬ψexit(C0) ∧ wk | = ψprog(∅, C0) ∧ w/k + 1 ∈ Lang(B(L ))
hot
∀ w ∈ WS • w0 | = ac ∧ ¬ψexit(C0) = ⇒ w0 | = ψprog(∅, C0) ∧ w/1 ∈ Lang(B(L )) ∀ w ∈ WS ∀ k ∈ N0 • wk | = ac ∧ ¬ψexit(C0) = ⇒ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
Software S satisfies a set of LSCs L1, . . . , Ln if and only if S | = Li for all 1 ≤ i ≤ n.
– 9 – 2017-06-19 – Stestplay –
39/54
LSC: buy softdrink AC: true AM: invariant I: permissive User
E1 pSOFT SOFT LSC: get change AC: true AM: invariant I: permissive User
C50 E1 pSOFT SOFT chg-C50
– 9 – 2017-06-19 – Stestplay –
39/54
LSC: buy softdrink AC: true AM: invariant I: permissive User
E1 pSOFT SOFT LSC: get change AC: true AM: invariant I: permissive User
C50 E1 pSOFT SOFT chg-C50
such that L accepts w(π). Prove S | = L by demonstrating π.
(∗: as well as (positive) scenarios in general, like use-cases)
– 9 – 2017-06-19 – Stestplay –
39/54
LSC: buy softdrink AC: true AM: invariant I: permissive User
E1 pSOFT SOFT LSC: get change AC: true AM: invariant I: permissive User
C50 E1 pSOFT SOFT chg-C50
such that L accepts w(π). Prove S | = L by demonstrating π.
(∗: as well as (positive) scenarios in general, like use-cases)
requirements fixed requirements fixed acceptance acceptance system specified system specified system delivered system delivered architecture designed architecture designed system integrated system integrated modules designed modules designed system realised system realised verification & validation
– 9 – 2017-06-19 – Stestplay –
39/54
LSC: buy softdrink AC: true AM: invariant I: permissive User
E1 pSOFT SOFT LSC: get change AC: true AM: invariant I: permissive User
C50 E1 pSOFT SOFT chg-C50
such that L accepts w(π). Prove S | = L by demonstrating π.
(∗: as well as (positive) scenarios in general, like use-cases)
requirements fixed requirements fixed acceptance acceptance system specified system specified system delivered system delivered architecture designed architecture designed system integrated system integrated modules designed modules designed system realised system realised verification & validation
– 9 – 2017-06-19 – Stestplay –
39/54
LSC: buy softdrink AC: true AM: invariant I: permissive User
E1 pSOFT SOFT LSC: get change AC: true AM: invariant I: permissive User
C50 E1 pSOFT SOFT chg-C50
such that L accepts w(π). Prove S | = L by demonstrating π.
(∗: as well as (positive) scenarios in general, like use-cases)
requirements fixed requirements fixed acceptance acceptance system specified system specified system delivered system delivered architecture designed architecture designed system integrated system integrated modules designed modules designed system realised system realised verification & validation
LSC:
AC: true AM: invariant I: permissive User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 pWATER
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!)
water_in_stock dWATER OK
¬(dSoft! ∨ dTEA!)
– 9 – 2017-06-19 – Stestplay –
39/54
LSC: buy softdrink AC: true AM: invariant I: permissive User
E1 pSOFT SOFT LSC: get change AC: true AM: invariant I: permissive User
C50 E1 pSOFT SOFT chg-C50
such that L accepts w(π). Prove S | = L by demonstrating π.
(∗: as well as (positive) scenarios in general, like use-cases)
requirements fixed requirements fixed acceptance acceptance system specified system specified system delivered system delivered architecture designed architecture designed system integrated system integrated modules designed modules designed system realised system realised verification & validation
LSC:
AC: true AM: invariant I: permissive User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 pWATER
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!)
water_in_stock dWATER OK
¬(dSoft! ∨ dTEA!)
– 9 – 2017-06-19 – Stestplay –
39/54
LSC: buy softdrink AC: true AM: invariant I: permissive User
E1 pSOFT SOFT LSC: get change AC: true AM: invariant I: permissive User
C50 E1 pSOFT SOFT chg-C50
such that L accepts w(π). Prove S | = L by demonstrating π.
(∗: as well as (positive) scenarios in general, like use-cases)
requirements fixed requirements fixed acceptance acceptance system specified system specified system delivered system delivered architecture designed architecture designed system integrated system integrated modules designed modules designed system realised system realised verification & validation
LSC:
AC: true AM: invariant I: permissive User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 pWATER
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!)
water_in_stock dWATER OK
¬(dSoft! ∨ dTEA!)
(Because they require that the software never ever exhibits the unwanted behaviour.)
Prove S | = L by demonstrating one π such that w(π) is not accepted by L .
– 9 – 2017-06-19 – Stestplay –
40/54
(Harel and Marelly, 2003)
– 9 – 2017-06-19 – main –
41/54
– 9 – 2017-06-19 – Sstrengthen –
42/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
– 9 – 2017-06-19 – Sstrengthen –
42/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
One quite effective approach: (i) Approximate the software requirements: ask for positive / negative existential scenarios. (ii) Refine result into universal scenarios (and validate them with customer).
– 9 – 2017-06-19 – Sstrengthen –
42/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
One quite effective approach: (i) Approximate the software requirements: ask for positive / negative existential scenarios. (ii) Refine result into universal scenarios (and validate them with customer).
That is:
– 9 – 2017-06-19 – Sstrengthen –
42/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
One quite effective approach: (i) Approximate the software requirements: ask for positive / negative existential scenarios. (ii) Refine result into universal scenarios (and validate them with customer).
That is:
In the sense of: “If the system is not at all able to do this, then it’s not what I want.” (→ positive use-cases, existential LSC)
– 9 – 2017-06-19 – Sstrengthen –
42/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
One quite effective approach: (i) Approximate the software requirements: ask for positive / negative existential scenarios. (ii) Refine result into universal scenarios (and validate them with customer).
That is:
In the sense of: “If the system is not at all able to do this, then it’s not what I want.” (→ positive use-cases, existential LSC)
In the sense of: “If the system does this, then it’s not what I want.” (→ negative use-cases, LSC with pre-chart and hot-false)
– 9 – 2017-06-19 – Sstrengthen –
42/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
One quite effective approach: (i) Approximate the software requirements: ask for positive / negative existential scenarios. (ii) Refine result into universal scenarios (and validate them with customer).
That is:
In the sense of: “If the system is not at all able to do this, then it’s not what I want.” (→ positive use-cases, existential LSC)
In the sense of: “If the system does this, then it’s not what I want.” (→ negative use-cases, LSC with pre-chart and hot-false)
(→ extend use-cases, refine LSCs with conditions or local invariants)
– 9 – 2017-06-19 – Sstrengthen –
42/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
One quite effective approach: (i) Approximate the software requirements: ask for positive / negative existential scenarios. (ii) Refine result into universal scenarios (and validate them with customer).
That is:
In the sense of: “If the system is not at all able to do this, then it’s not what I want.” (→ positive use-cases, existential LSC)
In the sense of: “If the system does this, then it’s not what I want.” (→ negative use-cases, LSC with pre-chart and hot-false)
(→ extend use-cases, refine LSCs with conditions or local invariants)
– 9 – 2017-06-19 – Sstrengthen –
42/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
One quite effective approach: (i) Approximate the software requirements: ask for positive / negative existential scenarios. (ii) Refine result into universal scenarios (and validate them with customer).
That is:
In the sense of: “If the system is not at all able to do this, then it’s not what I want.” (→ positive use-cases, existential LSC)
In the sense of: “If the system does this, then it’s not what I want.” (→ negative use-cases, LSC with pre-chart and hot-false)
(→ extend use-cases, refine LSCs with conditions or local invariants)
https://en.wikipedia.org/wiki/Mercedes-Benz_S-Class_%28W221%29#/media/File:Mercedes_W221_driver%27s_door_controls.JPG – Guido Gybels - CC BY-SA 3.0
– 9 – 2017-06-19 – Sstrengthen –
43/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
– 9 – 2017-06-19 – Sstrengthen –
43/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Button Controller position = bottom Motor Sensor down pressed move down bottom reached stop Button Controller position = bottom Motor Sensor down pressed down released move down stop Button Controller position = bottom Motor Sensor down pressed move down false position = bottom
– 9 – 2017-06-19 – Sstrengthen –
43/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Button Controller position = bottom Motor Sensor down pressed move down bottom reached stop Button Controller position = bottom Motor Sensor down pressed down released move down stop Button Controller position = bottom Motor Sensor down pressed move down false position = bottom
– 9 – 2017-06-19 – Sstrengthen –
43/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Button Controller position = bottom Motor Sensor down pressed move down bottom reached stop Button Controller position = bottom Motor Sensor down pressed down released move down stop Button Controller position = bottom Motor Sensor down pressed move down false position = bottom
LSC: move down 1 AM: invariant I: strict Button Controller position = bottom Motor Sensor down pressed move down bottom reached stop ¬down_released LSC: move down 2 AM: invariant I: strict Button Controller position = bottom Motor down pressed down released move down stop ¬bottom_reached LSC: don’t move AM: invariant I: strict Button Controller position = bottom down pressed down released ¬move_down
– 9 – 2017-06-19 – Sstrengthen –
43/54
Needs!
need 1 need 2 need 3 ...Solution! Customer Developer
announcement
(Lastenheft)
→
...e
Customer Developer
(Pflichtenheft)
→
spec 1 spec 2a spec 2b ...§
...e
Customer Developer
software contract
(incl. Pflichtenheft)
→
Needs! Developer Customer
software delivery
Button Controller position = bottom Motor Sensor down pressed move down bottom reached stop Button Controller position = bottom Motor Sensor down pressed down released move down stop Button Controller position = bottom Motor Sensor down pressed move down false position = bottom
LSC: move down 1 AM: invariant I: strict Button Controller position = bottom Motor Sensor down pressed move down bottom reached stop ¬down_released LSC: move down 2 AM: invariant I: strict Button Controller position = bottom Motor down pressed down released move down stop ¬bottom_reached LSC: don’t move AM: invariant I: strict Button Controller position = bottom down pressed down released ¬move_down
– 9 – 2017-06-19 – Sstrengthen –
44/54 Requirements on Requirements Specications
– 6 – 2017-05-22 – Sre –13/41
A requirements specification should be
— it correctly represents the wishes/needs of the customer,
— all requirements (existing in somebody’s head, or a document, or ...) should be present,
— things which are not relevant to the project should not be constrained,
— each requirement is compatible with all other requirements; otherwise the requirements are not realisable,
— a requirements specification does not constrain the realisation more than necessary,
— the sources of requirements are documented, requirements are uniquely identifiable,
— the final product can objectively be checked for satisfying a requirement.
which is usually only in the customer’s head. is is difficult to be sure of correctness and completeness.
It’s not unusual that even the customer does not precisely know...!
For example, the customer may not be aware of contradictions due to technical limitations.
if and only if there exists a set of words W such that n
i=1 W |
= Li.
– 9 – 2017-06-19 – Scontent –
45/54
– 9 – 2017-06-19 – main –
46/54
– 9 – 2017-06-19 – Sblockcontent –
47/54
VL 6 . . . VL 7 . . . VL 8 . . . VL 9 . . .
– 9 – 2017-06-19 – Swrapup –
48/54
http://commons.wikimedia.org (CC-by-sa 4.0, Dirk Ingo Franke)
Alphabet:
– dispense cash only,
– return card only,
C
– dispense cash and return card.
S1 =
C
ω
S2 = (M.C)ω or (C.M)ω
S3 = (C.M)ω
– 9 – 2017-06-19 – Swrapup –
49/54
Customer 2 Mmmh, Software!
Requirements S1 = {(M.C, · 1), (C.M, · 1)}
– 9 – 2017-06-19 – Swrapup –
49/54
Customer 2 Mmmh, Software!
Requirements S1 = {(M.C, · 1), (C.M, · 1)} Design S2 = {(M.TM.C, · 1), (C.TC.M, · 1)}
– 9 – 2017-06-19 – Swrapup –
49/54
Customer 2 Mmmh, Software!
Requirements S1 = {(M.C, · 1), (C.M, · 1)} Design S2 = {(M.TM.C, · 1), (C.TC.M, · 1)} Implementation S = {σ0
α1
− − → σ1
α2
− − → σ2 · · · , . . . }
– 9 – 2017-06-19 – Swrapup –
49/54
Customer 2 Mmmh, Software!
Requirements S1 = {(M.C, · 1), (C.M, · 1)} Design S2 = {(M.TM.C, · 1), (C.TC.M, · 1)} Implementation S = {σ0
α1
− − → σ1
α2
− − → σ2 · · · , . . . } Development Process/ Project Management
– 9 – 2017-06-19 – Swrapup –
50/54
neutral, traceable, objective.
easily maintainable, easily usable.
(Formal) inconsistency of, e.g., a decision table hints at inconsistencies in the requirements.
– 9 – 2017-06-19 – Swrapup –
51/54
– 9 – 2017-06-19 – Swrapup –
51/54
– 9 – 2017-06-19 – Swrapup –
51/54
and elaborate corner cases.
Thus, use cases can be very useful — use case diagrams not so much.
– 9 – 2017-06-19 – Swrapup –
51/54
and elaborate corner cases.
Thus, use cases can be very useful — use case diagrams not so much.
– 9 – 2017-06-19 – Swrapup –
51/54
and elaborate corner cases.
Thus, use cases can be very useful — use case diagrams not so much.
Ask for each requirements: what is the acceptance test?
– 9 – 2017-06-19 – Swrapup –
51/54
and elaborate corner cases.
Thus, use cases can be very useful — use case diagrams not so much.
Ask for each requirements: what is the acceptance test?
– 9 – 2017-06-19 – Swrapup –
51/54
and elaborate corner cases.
Thus, use cases can be very useful — use case diagrams not so much.
Ask for each requirements: what is the acceptance test?
(as safety precaution, e.g., in lawsuits).
– 9 – 2017-06-19 – Swrapup –
52/54
(Rupp and die SOPHISTen, 2014)
– 9 – 2017-06-19 – main –
53/54
– 9 – 2017-06-19 – main –
54/54 Harel, D. and Marelly, R. (2003). Come, Let’s Play: Scenario-Based Programming Using LSCs and the Play-Engine. Springer-Verlag. Ludewig, J. and Lichter, H. (2013). Software Engineering. dpunkt.verlag, 3. edition. Rupp, C. and die SOPHISTen (2014). Requirements-Engineering und -Management. Hanser, 6th edition.