Softwaretechnik / Software-Engineering Lecture 10: Req. Eng. Wrap-Up / Architecture & Design 2017-06-22 Prof. Dr. Andreas Podelski, Dr. Bernd Westphal Albert-Ludwigs-Universität Freiburg, Germany – 10 – 2017-06-22 – main – Topic Area Requirements Engineering: Content • Introduction VL 6 • Requirements Specification • Desired Properties • Kinds of Requirements • Analysis Techniques . . . • Documents • Dictionary, Specification • Specification Languages • Natural Language • Decision Tables VL 7 • Syntax, Semantics . . • Completeness, Consistency, ... . • Scenarios VL 8 . • User Stories, Use Cases . . • Live Sequence Charts – 10 – 2017-06-22 – Sblockcontent – VL 9 • Syntax, Semantics . . . • Definition: Software & SW Specification VL 10 . • Wrap-Up . . 2 /60
Content • LSCs: Automaton Construction • Excursion: Symbolic Büchi Automata • LSCs vs. Software • Methodology • Requirements Engineering with scenarios • Strengthening scenarions into requirements • Requirements Engineering Wrap-Up Topic Area Architecture & Design • Vocabulary • (software) system, component, module, interface • design, architecture • Software Modelling – 10 – 2017-06-22 – Scontent – • model • views & viewpoints, the 4+1 view • model-driven software engineering 3 /60 TBA Construction Principle “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 } =: � hot loop ( q ) � �� � � Msg ( q ) � � LocInv ( q ) � � LocInv � loop ( q ) = ( q ) hot cold � exit ( q ) = � prog ( q, q n ) = =: � hot prog ( q,qn ) � � � hot loop ( q ) � ¬ � LocInv q ( q ) � �� � cold � Msg ( q, q n ) � � Cond hot ( q, q n ) � � LocInv , • ( q, q n ) � � � hot � hot prog ( q, q i ) cold ( q, q n ) � � LocInv , • 1 � i � n � � Cond ( q, q n ) cold � �� ¬ � LocInv , • ( q, q i ) � ¬ � Cond cold ( q, q i ) � cold ... q 1 q n I 1 I 2 I 3 true A c 2 � c 3 C B c 1 – 9 – 2017-06-19 – Slscsem – D E – 10 – 2017-06-22 – main – 26 /54 4 /60
Loop Condition � loop ( q ) = � Msg ( q ) � � LocInv ( q ) � � LocInv ( q ) hot cold � • � Msg ( q ) = ¬ � � � 1 � i � n � Msg ( q, q i ) � ¬ � strict = � � � E !? � Msg ( L ) � �� � =: � strict ( q ) ( q ) = � • � LocInv � =( 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 ( l o , � 0 , � , l 1 , � 1 ) is active at cut (!) q if and only if l 0 � l � l 1 for some front location l of cut q or l = l 1 � � 1 = • . • Msg ( F ) = { E ! | ( l, E, l � ) � Msg , l � F} � { E ? | ( l, E, l � ) � Msg , l � � F} • Msg ( F 1 , . . . , F n ) = � 1 � i � n Msg ( F i ) I 1 I 2 I 3 A c 2 � c 3 C B c 1 – 9 – 2017-06-19 – Slscsem – D E – 10 – 2017-06-22 – main – 27 /54 5 /60 Progress Condition � hot prog ( q, q i ) = � Msg ( q, q n ) � � Cond hot ( q, q n ) � � LocInv , • ( q n ) hot • � Msg ( q, q i ) = � � � Msg ( q i \ q ) � � � � � � ( Msg ( q j \ q ) \ Msg ( q i \ q )) ¬ � j 6 = i � � � � strict = � ¬ � � � ( E !? � Msg ( L )) \ Msg ( F i ) � �� � =: � strict ( q,q i ) ( q, q i ) = � • � Cond � =( L, � ) � Cond , � ( � )= � , L � ( q i \ q ) 6 = � � � ( q, q i ) = � • � LocInv , • � =( l, � , � ,l � , � � ) � LocInv , � ( � )= � , � • -active at q i � � Local invariant ( l 0 , � 0 , � , l 1 , � 1 ) is • -active at q if and only if • l 0 � l � l 1 , or I 1 I 2 I 3 • l = l 0 � � 0 = • , or • l = l 1 � � 1 = • A for some front location l of cut (!) q . c 2 � c 3 C B c 1 – 9 – 2017-06-19 – Slscsem – D E – 10 – 2017-06-22 – main – 28 /54 6 /60
Content • LSCs: Automaton Construction • Excursion: Symbolic Büchi Automata • LSCs vs. Software • Methodology • Requirements Engineering with scenarios • Strengthening scenarions into requirements • Requirements Engineering Wrap-Up Topic Area Architecture & Design • Vocabulary • (software) system, component, module, interface • design, architecture • Software Modelling – 10 – 2017-06-22 – Scontent – • model • views & viewpoints, the 4+1 view • model-driven software engineering 8 /60
Excursion: Symbolic Büchi Automata – 10 – 2017-06-22 – main – 9 /60 From Finite Automata to Symbolic Büchi Automata A : Σ = { 0 , 1 } B : Σ = { 0 , 1 } 0 0 Büchi q 1 q 2 q 1 q 2 infinite words 1 1 B ′ : 0 Σ = { 0 , 1 } 1 q 1 q 2 1 0 symbolic symbolic A sym : Σ = ( { x } → N ) B sym : Σ = ( { x } → N ) even ( x ) even ( x ) Büchi q 1 q 2 q 1 q 2 infinite words odd ( x ) odd ( x ) – 10 – 2017-06-22 – Stba – 10 /60
Symbolic Büchi Automata Definition. A Symbolic Büchi Automaton (TBA) is a tuple B = ( C B , Q, q ini , → , Q F ) where • C B is a set of atomic propositions, • Q is a finite set of states , • q ini ∈ Q is the initial state, • → ⊆ Q × Φ( C B ) × Q is the finite transition relation . Each transitions ( q, ψ, q ′ ) ∈ → from state q to state q ′ is labelled with a formula ψ ∈ Φ( C B ) . • Q F ⊆ Q is the set of fair (or accepting) states. – 10 – 2017-06-22 – Stba – 11 /60 Run of TBA Definition. Let B = ( C B , Q, q ini , → , Q F ) be a TBA and w = σ 1 , σ 2 , σ 3 , · · · ∈ (Φ( C B ) → B ) ω an infinite word, each letter is a valuation of Φ( C B ) . An infinite sequence ̺ = q 0 , q 1 , q 2 , . . . ∈ Q ω of states is called run of B over w if and only if • q 0 = q ini , • for each i ∈ N 0 there is a transition ( q i , ψ i , q i +1 ) ∈→ s.t. σ i | = ψ i . B sym : Σ = ( { x } → N ) even ( x ) Example : q 1 q 2 – 10 – 2017-06-22 – Stba – odd ( x ) 12 /60
The Language of a TBA Definition. We say TBA B = ( C B , Q, q ini , → , Q F ) accepts the word w = ( σ i ) i ∈ N 0 ∈ (Φ( C B ) → B ) ω if and only if B has a run ̺ = ( q i ) i ∈ N 0 over w such that fair (or accepting) states are visited infinitely often by ̺ , i.e., such that ∀ i ∈ N 0 ∃ j > i : q j ∈ Q F . We call the set Lang ( B ) ⊆ (Φ( C B ) → B ) ω of words that are accepted by B the language of B . B sym : Σ = ( { x } → N ) even ( x ) – 10 – 2017-06-22 – Stba – Example : q 1 q 2 odd ( x ) 13 /60 LSCs vs. Software – 10 – 2017-06-22 – main – 14 /60
LSCs as Software Specification A software S is called compatible with LSC L over C and E is if and only if • Σ = ( C → B ) , i.e. the states are valuations of the conditions in C , • A ⊆ E !? , i.e. the events are of the form E ! , E ? (viewed as a valuation of E ! , E ? ). α 1 α 2 A computation path π = σ 0 − − → σ 1 − − → σ 2 · · · ∈ � S � of software S induces the word w ( π ) = ( σ 0 ∪ α 1 ) , ( σ 1 ∪ α 2 ) , ( σ 2 ∪ α 3 ) , . . . , we use W S 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 ∃ w ∈ W S • w 0 | ∃ w ∈ W S ∃ k ∈ N 0 • w k | = ac ∧ ¬ ψ exit ( C 0 ) = ac ∧ ¬ ψ exit ( C 0 ) cold ∧ w 0 | ∧ w k | = ψ prog ( ∅ , C 0 ) ∧ w/ 1 ∈ Lang ( B ( L )) = ψ prog ( ∅ , C 0 ) ∧ w/k + 1 ∈ Lang ( B ( L )) ∀ w ∈ W S • w 0 | ∀ w ∈ W S ∀ k ∈ N 0 • w k | = ac ∧ ¬ ψ exit ( C 0 ) = ac ∧ ¬ ψ exit ( C 0 ) hot ⇒ w 0 | ⇒ w k | = ψ Cond = = ψ prog ( ∅ , C 0 ) ∧ w/ 1 ∈ Lang ( B ( L )) = hot ( ∅ , C 0 ) ∧ w/k +1 ∈ Lang ( B ( L )) – 10 – 2017-06-22 – Stestplay – Software S satisfies a set of LSCs L 1 , . . . , L n if and only if S | = L i for all 1 ≤ i ≤ n . 15 /60
Recommend
More recommend