3d5158f985774287e4da2912e007bc6c.ppt
- Количество слайдов: 19
Requirement Specification Corso IS I - 2002/03 Gianna Reggio Versione 0. 0
Structuring requirement capture and specification • Use case approach – widely accepted technique in OO development methods (as those based on UML) – but, in our experience, too “fuzzy” * who are actors? , * what are the strings appearing in behaviour diagrams? * what is my responsibility? – We think that a more systematic and stringent structuring may make the process faster (avoiding endless discussions) and improve consistency of the produced specification v. 0. 0
The Algebraic Lottery case study • Tickets are numbered by integer numbers, the winners are determined by means of an order over such numbers, and players buy tickets by selecting their number • Whenever a player buys a ticket, he gets the right to another free ticket, which will be given at some future time, fully depending on the lottery manager decision, whose number is generated by the set of the numbers of the already assigned tickets following some law • Tickets are paid on-line using credit cards with the help of an external service • Clients must register to play and access the system in a session-like way. An external service takes care of the registration and of the distribution of the session keys v. 0. 0
Domain model A UML package describing in an OO fashion the part of the real world that concerns the SYSTEM, but without any reference to the SYSTEM itself, nor to the problem to which the SYSTEM provides a solution Player How many free tickets he may get. Free. Ticket: Int buy. Ticket(Int) * Ticket Own free. Tickets: Int = 0 1 num: Int * Current. Lottery 1 Lottery The number of tickets of the lottery is (2*dim)+1. dim: Int winners: Sequence(Player) available. Ticktes: Int Order 1 Order just the rules governing less. Than(Int, Int): Bool the lottery noi non lo consideriamo 1 Law new. Number(Set(Int), Int): Int v. 0. 0
Requirement specification structure Use. Case View general: Use. Case. Diagram 1 Requirement Specification distinguendo i vari tipi di use cases: es. summary e user level v. 0. 0
actor identifier User of the Services provided by the SYSTEM Use Case Diagram PL: Person Disconnect Buy a ticket CC: Credit. Card Handler Register C: Person Give free tickets Draw the winners MAN: Manager Start a new lottery E: Email secondary actors actor type primary actors Connect AC: Access Handler Providers of the Services needed by the SYSTEM actors are roles for any kind of entities outside the SYSTEM interacting with it v. 0. 0
Requirement specification structure Use. Case View general: Use. Case. Diagram 1 Dictionary Requirement Specification 1 definition: Package v. 0. 0
Dictionary • a UML package describing all the data entities needed to present the use cases, the context and the internal structure of the SYSTEM Order Law less. Than(Int, Int): Bool new. Number(Set(Int), Int): Int <
Requirement specification structure Use. Case View Context View general: Use. Case. Diagram definition: Package 1 1 Dictionary Requirement Specification 1 definition: Package v. 0. 0
Context View • a UML package importing the Dictionary containing at least a class diagram, where all classes are of three stereotypes: System, Service. User and Service. Provider Email Credit. Card Handler 1 1 <
Requirement specification structure Internal View Use. Case View definition: Package general: Use. Case. Diagram 1 Context View definition: Package 1 1 Dictionary Requirement Specification 1 definition: Package v. 0. 0
Internal View • describes at an extremely abstract level the structure (architecture) of the SYSTEM, consisting of a unique active object able to perform the SYSTEM activities and by many passive objects defining the SYSTEM Abstract. State How many free tickets he may get. Player. R free. Tickets: Int = 0 connected: Bool = False session. Key: Key Own COD: Code 1 * data: Personal. Data credit. Card: Credit. Card. Data buy. Ticket(Int) get. Free. Ticket: Int connect(Key) disconnect * Ticket num: Int * Tickets Players <
stile adeguato (es. chiarire il goal, narrativo, cosa fanno gli attori, il sistema, pre-post condizioni per lo use case) Requirement specification structure Use. Case Behaviour View Use. Case Causal View Use. Case Interaction View definition: State. Chart definition: Collaboration definition: Activity. Diagram 1 * 0. . 1 Use. Case Description textual. Description: String 1. . * Internal View Use. Case View definition: Package general: Use. Case. Diagram 1 Context View definition: Package 1 1 Dictionary Requirement Specification 1 definition: Package v. 0. 0
Use Case Behaviour View • mandatory • statechart for the System class describing the complete behaviour of the SYSTEM with respect the use case (≠ few scenarios) – events triggering its transitions = calls of the operations of the System class – conditions on its transitions = tests on the SYSTEM Abstract. State – actions appearing on its transitions = either calls of the operations of the context entity classes and statements updating the SYSTEM Abstract. State v. 0. 0
Use case “Register” Behaviour View operazione della sua classe attore dello use case register. Me(C, D, C) [not D. ok() or not C. ok()] / C. failed. Registration(); wrong. Card(C) / C. failed. Registration(); register. Me(C, D, C) [D. ok() and C. ok()] / CC. check(C); ok. Card(C) / cod =AH. register(D, C); pr = create(Player. R, Credit. Card = C, COD = cod, data = D); Players = Players U {pr}; C. are. Registered(cod); azione sull’Abstract Internal State operazione della classe SYSTEM fatta da un attore v. 0. 0
Use Case Interaction View • any number, but must be coherent with the Behaviour View • a collaboration diagram representing the interactions happening in a which? scenario of the use case context entities the SYSTEM Abstract the internal constituents Executorof the SYSTEM context entities E Passive A_Executor Passive Components components of Abstract. State v. 0. 0
Use case “Register” Interaction View E CC: Credit. Card C: Person Handler AH: Accesses Handler register. Me(cl, D, Ca) check(Ca) ok. Card(Ca) create(Credit. Card=Ca, COD=cod, Player. R data=D) cod = register(D, Ca) are. Registered(cod) v. 0. 0
Use Causal View • optional, but must be coherent with the Behaviour View • Activity Diagram for the SYSTEM, describing all the relevant facts happening during the use case and their causal relationships – its action-states * calls of the operations of SYSTEM by the context entities * calls of the operations of the context entities by SYSTEM * actions producing side effects on the SYSTEM Abstract. State – its guards = conditions on the SYSTEM Abstract. State v. 0. 0
Use case “Give Free Tickets” Causal View v. 0. 0


