– 10 – 2015-06-15 – main –
Softwaretechnik / Software-Engineering
Lecture 10: Live Sequence Charts Cont’d
2015-06-15
- Prof. Dr. Andreas Podelski, Dr. Bernd Westphal
Albert-Ludwigs-Universit¨ at Freiburg, Germany
Lecture 10: Live Sequence Charts Contd 2015-06-15 Prof. Dr. Andreas - - PowerPoint PPT Presentation
Softwaretechnik / Software-Engineering Lecture 10: Live Sequence Charts Contd 2015-06-15 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal 10 2015-06-15 main Albert-Ludwigs-Universit at Freiburg, Germany Contents & Goals
– 10 – 2015-06-15 – main –
Albert-Ludwigs-Universit¨ at Freiburg, Germany
– 10 – 2015-06-15 – Sprelim –
2/31 Last Lecture:
This Lecture:
– 10 – 2015-06-15 – main –
3/31
Finally: The LSC Semantics
– 09 – 2015-06-11 – Slscsem –
23/50
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
Concrete syntax:
LSC: L1 AC: c1 AM: initial I: permissive
I1 I2 I3
E F G
– 10 – 2015-06-15 – Sflscsem –
4/31
A full LSC L = (((L, , ∼), I, Msg, Cond, LocInv, Θ), ac0, am, ΘL ) consist of
A set of words W ⊆ (C → B)ω is accepted by L if and only if
ΘL am = initial am = invariant cold ∃ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∃ w ∈ W ∃ k ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
hot ∀ w ∈ W • w0 | = ac = ⇒ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∀ w ∈ W ∀ k ∈ N0 • wk | = ac = ⇒ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
where ac = ac0 ∧ ψCond
cold (∅, C0) ∧ ψMsg(∅, C0); C0 is the minimal (or instance heads) cut.
– 10 – 2015-06-15 – Sflscsem –
5/31
LSC: L1 AC: c1 AM: initial I: permissive
I1 I2 I3
E F G
LSC: L1 AM: initial I: permissive
I1 I2 I3
E F G c1
– 10 – 2015-06-15 – main –
6/31
– 10 – 2015-06-15 – Sswlsc –
7/31 Let S be a software with S = {π = σ0
α1
− − → σ1
α2
− − → σ2 · · · | · · · }. S is called compatible with LSC L over C and E is if and only if
Construct letters by joining σi and αi+1 (viewed as a valuation of E!, E?): w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . .
– 10 – 2015-06-15 – Sswlsc –
7/31 Let S be a software with S = {π = σ0
α1
− − → σ1
α2
− − → σ2 · · · | · · · }. S is called compatible with LSC L over C and E is if and only if
Construct letters by joining σi and αi+1 (viewed as a valuation of E!, E?): w(π) = (σ0 ∪ α1), (σ1 ∪ α2), (σ2 ∪ α3), . . . We say S satisfies LSC L (e.g. universal, invariant), denoted by S | = L , if and only if ∀ π ∈ S ∀ k ∈ N0 • w(π)k | = ac = ⇒ w(π)k | = ψCond
hot (∅, C0) ∧ w(π)/k + 1 ∈ Lang(B(L ))
ΘL am = initial am = invariant cold ∃ w ∈ W • w0 | = ac ∧ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∃ w ∈ W ∃ k ∈ N0 • wk | = ac ∧ wk | = ψCond
hot (∅, C0)∧w/k+1 ∈ Lang(B(L ))
hot ∀ w ∈ W • w0 | = ac = ⇒ w0 | = ψCond
hot (∅, C0) ∧ w/1 ∈ Lang(B(L ))
∀ w ∈ W ∀ k ∈ N0 • wk | = ac = ⇒ 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.
– 10 – 2015-06-15 – Sswlsc –
8/31
(Σ × A)ω
?!
Customer Analyst
requirements analysis
One quite effective approach: try to approximate the requirements with positive and negative scenarios.
“If the system is not at all able to do this, then it’s not what I want.”
“If the system does this, then it’s not what I want.”
what about exceptional cases? what about corner-cases? etc.
– 10 – 2015-06-15 – Sswlsc –
9/31 LSC: buy softdrink AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT
– 10 – 2015-06-15 – Sswlsc –
10/31 LSC: get change AC: true AM: invariant I: permissive
User
C50 E1 pSOFT SOFT chg-C50
– 10 – 2015-06-15 – Sprechart –
11/31 LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
– 10 – 2015-06-15 – Sprechart –
12/31
LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
A full LSC L = (PC, MC, ac0, am, ΘL ) actually consist of
– 10 – 2015-06-15 – Sprechart –
13/31
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))
– 10 – 2015-06-15 – Sprechart –
14/31
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
LSC:
AC: true AM: invariant I: permissive
User
E1 pSOFT SOFT SOFT ¬C50! ∧ ¬E1! false
(∗: as well as (positive) scenarios in general, like use-cases)
(Because they require that the software never ever exhibits the unwanted behaviour.)
– 10 – 2015-06-15 – Sprechart –
15/31
(Σ × A)ω
(Σ × A)ω
Customer Analyst
requirements analysis
– 10 – 2015-06-15 – Sprechart –
16/31
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 pWATER water in stock dWATER OK
– 10 – 2015-06-15 – Sprechart –
16/31
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
– 10 – 2015-06-15 – Sprechart –
16/31
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!)
– 10 – 2015-06-15 – Sprechart –
17/31
LSC: buy water AC: true AM: invariant I: strict
User CoinValidator ChoicePanel Dispenser C 5 pWATER
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!
water in stock dWATER OK
¬(dSoft! ∨ dTEA!)
LSC: buy water AC: true AM: invariant I: strict
User CoinValidator ChoicePanel Dispenser C 5 p W A T E R water in stock dWATER OK
– 10 – 2015-06-15 – Sprechart –
18/31
LSC: L AM: invariant I: permissive
I1 I2 I3 I4
E F
LSC: L AM: invariant I: permissive
I1 I2 I3 I4
E F
true
– 10 – 2015-06-15 – Sprechart –
19/31
– 05 – 2015-05-11 – Sre –
22/90
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.
– 10 – 2015-06-15 – Sprechart –
20/31
customer” → still difficult;
relative completeness in the sense of “did we cover all (exceptional) cases?”;
→ still difficult; But LSCs tend to support abstract specifications; specifying technical details is tedious.
meta-properties, need to be established separately;
using LSCs, is immediately
For Decision Tables, we formally defined additional quality criteria:
What about LSCs?
– 10 – 2015-06-15 – main –
21/31
– 10 – 2015-06-15 – Sdrawbacks –
22/31
Recall: Most severe drawbacks of, e.g., MSCs:
msc event_ordering
proc_a proc_b proc_c m1
m2 m3 m4
(a)
(ITU-T, 2011)
LSC: buy water AC: true AM: invariant I: strict User CoinValidator ChoicePanel Dispenser C50 p W A T E R
¬(C50! ∨ E1! ∨ pSOFT! ∨ pTEA! ∨ pFILLUP!
water in stock dWATER OK
¬(dSoft! ∨ dTEA!)
– 10 – 2015-06-15 – Sdrawbacks –
23/31
(Harel and Marelly, 2003)
– 10 – 2015-06-15 – main –
24/31
– 10 – 2015-06-15 – Swrapup –
25/31
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.
C
(M.C) or (C.M)
(C.M)
– 10 – 2015-06-15 – Swrapup –
26/31
Mmmh, Software!
Requirements S1 = {(M.C, · 1), (C.M, · 1)} Design S2 = {(M.TM.C, · 1), (C.TC.M, · 1)} Implementation S = {σ0
τ
− → σ1
τ
− → σ2 · · · , . . . } Development Process/ Project Management
– 10 – 2015-06-15 – Swrapup –
26/31
Mmmh, Software!
Requirements S1 = {(M.C, · 1), (C.M, · 1)} Design S2 = {(M.TM.C, · 1), (C.TC.M, · 1)} Implementation S = {σ0
τ
− → σ1
τ
− → σ2 · · · , . . . } Development Process/ Project Management
elicit req.(in.) analyst customer
elicitation
req.(in.) formalise req.(fo.) analyst
formalisation
req.(fo.) verify req.(fo.) ✔/✘ analyst
verification
req.(fo.) ✘ fix req.(fo.) analyst
repair
req.(fo.) ✔ validate req.(in.) analyst customer
validation
– 10 – 2015-06-15 – Swrapup –
27/31
One sometimes distinguishes:
Requirements typically stated in terms of system observables (“press WATER button”), needs to be mapped to terms of the software!
Requirements stated in terms of the software.
We touched a bit of both, aimed at a general discussion.
Distinguish domain elements and software elements and (try to) keep them apart to avoid confusion.
– 10 – 2015-06-15 – Swrapup –
28/31
– 03 – 2015-04-30 – Sprocedure –
32/77
Lehmann (Lehman, 1980; Lehman and Ramil, 2001) distinguishes three classes of software (my interpretation, my examples):
be specified; tend to be small; can be developed once and for all. Examples: sorting, compiler (!), compute π or √ · , cryptography, textbook examples, . . .
in feedback loop; specification needs domain model (cf. Bjørner (2006), “A tryptich software development paradigm”); formal specification (today) possible, in terms of domain model, yet tends to be expensive Examples: cruise control, autopilot, traffic lights controller, plant automatisation, . . .
specification often not clear, not even known; can grow huge; delivering the software induces new needs Examples: basically everything else; word processor, web-shop, game, smart-phone apps, . . .
– 10 – 2015-06-15 – Swrapup –
29/31
(Rupp and die SOPHISTen, 2014)
– 10 – 2015-06-15 – main –
30/31
– 10 – 2015-06-15 – main –
31/31
Harel, D. and Marelly, R. (2003). Come, Let’s Play: Scenario-Based Programming Using LSCs and the Play-Engine. Springer-Verlag. ITU-T (2011). ITU-T Recommendation Z.120: Message Sequence Chart (MSC), 5 edition. 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.