Скачать презентацию ÓAdriano Comai 1999 Introduzione ai casi d uso Use Скачать презентацию ÓAdriano Comai 1999 Introduzione ai casi d uso Use

81d3c96621ea5e75c89b234dc7d840e3.ppt

  • Количество слайдов: 28

ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases: an Introduction Ó Adriano Comai ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases: an Introduction Ó Adriano Comai 1999 www. analisi-disegno. com Pag. 1

Introduzione ai casi d’uso ÓAdriano Comai 1999 Goals of this Introduction • To provide Introduzione ai casi d’uso ÓAdriano Comai 1999 Goals of this Introduction • To provide basic information about use cases • To provide suggestions about their use in application development • These points are treated in more depth, with exercises, in the course “Requirements and Use Cases Definition”: http: //www. analisi-disegno. com/a_comai/corsi/sk_req. htm www. analisi-disegno. com Pag. 2

ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases • Proposed by Ivar Jacobson ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases • Proposed by Ivar Jacobson (book published in 1992) • New terminology, but a long practised technique (study of operational scenarios of system usage) • Use cases are the “ways” in which a system can be used (the functions which the system provides to its users) www. analisi-disegno. com Pag. 3

Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Case : Point of View A Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Case : Point of View A use case describes a function from the point of view of its users: • It starts usually with a request from an actor to the system • It ends with the production of all the answers to the request • It defines the interactions (between system and actors) related to the function The point of view to take into account must be the actor’s, not the one of the system www. analisi-disegno. com Pag. 4

Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases vs (Internal) Functions Use Cases Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases vs (Internal) Functions Use Cases • call someone • receive a call • send a message • memorize a number • …. Point of view: USER www. analisi-disegno. com Internal Functions • transmit / receive • energy (battery) • user I/O (display, keys, . . . ) • phone-book mgmt. • …. . Point of view: DESIGNER Pag. 5

ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases vs (Internal) Functions customer electronic ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases vs (Internal) Functions customer electronic banking systems administrator Use Cases • customer: – orders (payment, buy stocks, etc. ) – inquiries – contract Internal functions • • • specialized front-ends common front-end pre-application controls contract management system monitoring • administrator: – verify anomalies www. analisi-disegno. com Pag. 6

Introduzione ai casi d’uso ÓAdriano Comai 1999 Use cases as Interaction • Use cases Introduzione ai casi d’uso ÓAdriano Comai 1999 Use cases as Interaction • Use cases can be described as an interaction scenario (a dialogue) between the users and the system: – – – customer asks for a list of products system shows available products customer chooses products she wants system shows total cost of selected products customer confirms order system communicates acceptance of order • Attention must be given to the interaction, not to internal system activities www. analisi-disegno. com Pag. 7

Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases Identification 1 Identify system users Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases Identification 1 Identify system users (“actors”) 2 (For each actor) discover in which ways the actor will use the system, starting from the goals the actor has to achieve 3 (For each use case) clarify how the activity starts, the answers the actors expect from the system, the sequence of the interaction Þ Use cases help to discover requirements www. analisi-disegno. com Pag. 8

Introduzione ai casi d’uso ÓAdriano Comai 1999 Requirements and Use Cases (functional) requirement : Introduzione ai casi d’uso ÓAdriano Comai 1999 Requirements and Use Cases (functional) requirement : a function, or a characteristic of a function, requested by the customer or by some other stakeholders of the system use case: a way the system can be used by a user (actor) • Each use can satisfy many functional requirements • A functional requirement can be related to many use cases • Each use can have many non-functional requirements associated to it www. analisi-disegno. com Pag. 9

Introduzione ai casi d’uso ÓAdriano Comai 1999 Prototype and Use Cases • For each Introduzione ai casi d’uso ÓAdriano Comai 1999 Prototype and Use Cases • For each use case there is an interaction between actors and system, realized through interfaces • It is a good idea to prototype the interaction (especially between system and human beings) during use case definition : – use case and prototype are complementary ways to depict the interaction – UI prototype helps to clarify use case sequence – use case description helps to discover needed links between interfaces www. analisi-disegno. com Pag. 10

Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Case (Jacobson’s Definitions) • (in a Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Case (Jacobson’s Definitions) • (in a business system): “A sequence of transactions in a system whose task is to yield a result of measurable value to an individual actor of the business system” • (in an information system): “A behaviourally related sequence of transactions performed by an actor in a dialogue with the system to provide some measurable value to the actor”(Jacobson 1995) www. analisi-disegno. com Pag. 11

ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases and Transactions Each use can ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases and Transactions Each use can be implemented by a sequence of transactions in the system, in order to provide the aswers needed by the actor customer open account Transactions: * verify existence of customer in DB * insert new customer * scan signature of customer * insert new account www. analisi-disegno. com Pag. 12

ÓAdriano Comai 1999 Introduzione ai casi d’uso Actors • Entities interacting with the system, ÓAdriano Comai 1999 Introduzione ai casi d’uso Actors • Entities interacting with the system, through messages • Actors can be: – human beings – organizations – other systems (both hardware and software) • Each actor is a class, and may have many instances – Ex. Actor “customer” is a class; every individual customer is a member of the class www. analisi-disegno. com Pag. 13

ÓAdriano Comai 1999 Introduzione ai casi d’uso “Business Actors” vs. “Information System Actors” A ÓAdriano Comai 1999 Introduzione ai casi d’uso “Business Actors” vs. “Information System Actors” A model independent from any organizational and technological solution The model of a specific organizational and technological solution www. analisi-disegno. com Customer Order Clerk places an order Pag. 14

Introduzione ai casi d’uso ÓAdriano Comai 1999 “Business Actors” vs. “Information System Actors” Actors Introduzione ai casi d’uso ÓAdriano Comai 1999 “Business Actors” vs. “Information System Actors” Actors can be defined following two points of view, both important and legitimate, corresponding to two different levels of abstraction : • Independent from specific organizational and technological solutions (“Business Model”) • Dependent on a specific organizational and technological solution (“Information System Model”) www. analisi-disegno. com Pag. 15

ÓAdriano Comai 1999 Introduzione ai casi d’uso Business / IS Model order clerk customer ÓAdriano Comai 1999 Introduzione ai casi d’uso Business / IS Model order clerk customer administration places an order From the point of view of the customer, the order clerk is a part of the system (as a mediator, an interface) www. analisi-disegno. com Pag. 16

ÓAdriano Comai 1999 Introduzione ai casi d’uso Mediation Forms clerk ATM customer internet phone ÓAdriano Comai 1999 Introduzione ai casi d’uso Mediation Forms clerk ATM customer internet phone request of statement of account • The interface between actor and system changes • The logic core does not change www. analisi-disegno. com Pag. 17

ÓAdriano Comai 1999 Introduzione ai casi d’uso Mediation Forms • “human” interface: • pros: ÓAdriano Comai 1999 Introduzione ai casi d’uso Mediation Forms • “human” interface: • pros: flexibility, able to adapt to the specific actor • cons: cost, absence of uniformity • “automated” interface: • pros: cost, uniformity • cons: not able to understand requests that are either not-predefined, or specified in an unexpected way www. analisi-disegno. com Pag. 18

Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases and Scenarios • Base Scenario Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases and Scenarios • Base Scenario : (usually) implies success, and a linear development of the use case • Alternate Scenarios : can imply success or failure, with various complications • we do not need (it would be very expensive) a detailed analysis of every possible use case scenario (combination of variances) • but we must discover every variance that can bring to the failure of the use case, or that needs a specific treatment www. analisi-disegno. com Pag. 19

Introduzione ai casi d’uso ÓAdriano Comai 1999 example: open account 1 Customer goes to Introduzione ai casi d’uso ÓAdriano Comai 1999 example: open account 1 Customer goes to the bank to open an account 2 Clerk welcomes customer and gives explanations 3 If customer accepts rates she gives her personal info 4 Clerk verifies if customer is already known to the bank 5 Clerk opens a new account 6 Clerk gives the customer an account number Variances: 3 (a) If customer does not accept, use case ends 3 (b) If the account is opened by many people, it is necessary to give personal info of every holder 4 (a) If customer (one of the set of customers) is not known, clerk registers her, asks for the signature, scans the signature www. analisi-disegno. com Pag. 20

Introduzione ai casi d’uso ÓAdriano Comai 1999 example: open account - more detail (5) Introduzione ai casi d’uso ÓAdriano Comai 1999 example: open account - more detail (5) Clerk opens a new account 1 Clerk starts transaction “open account” 2 System asks customers’ codes 3 Clerk inputs codes 4 System shows corresponding personal info, and asks for rates 5 Clerk inputs rates, and confirms 6 System prints contract, with new account number Variances: 3 (a) if system does not know a customer, or displays unexpected data, clerk can correct or stop the transaction www. analisi-disegno. com Pag. 21

ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Case Levels Use cases are a ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Case Levels Use cases are a specific way to represent functions, and they can describe objects at different levels: • system • subsystem • component (or class) Whatever the level, use cases define a behaviour of the object they describe, without revealing its internal structure www. analisi-disegno. com Pag. 22

Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases at the “Business Event” Level Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases at the “Business Event” Level It is possible to identify and describe use cases at the level of events triggered by actors (each use case implies every needed answer to the event): • • • Update Web catalog Customer Info Request Customer Order Payment Assistance Request www. analisi-disegno. com Pag. 23

Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases at the “Transaction” Level It Introduzione ai casi d’uso ÓAdriano Comai 1999 Use Cases at the “Transaction” Level It is possible to identify and describe use cases at the level of each transaction, down to the point of atomic operations (CRUD) on the classes of the system: • • Create Order Read Order Update Order Delete Order www. analisi-disegno. com Pag. 24

Introduzione ai casi d’uso ÓAdriano Comai 1999 From which Level to Start? For a Introduzione ai casi d’uso ÓAdriano Comai 1999 From which Level to Start? For a medium-sized system we can have: • about a dozen use cases at the “business event” level – complete functions from the point of view of actors – meaningful delivery (and system test) units • more than one hundred use cases at the “transaction” level – internal system functions – can be too fragmented to be used as a basis of understanding between designers and with system customers www. analisi-disegno. com Pag. 25

ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Case Role Customer Seller Requirements Use ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Case Role Customer Seller Requirements Use case: Customer Order Delivery Units Analysis & Design Models Test cases www. analisi-disegno. com Pag. 26

ÓAdriano Comai 1999 Introduzione ai casi d’uso Are Use Cases OO? • Were “Invented” ÓAdriano Comai 1999 Introduzione ai casi d’uso Are Use Cases OO? • Were “Invented” in an Object Oriented context • Describe system functions from the point of view of the external actors (like OO messages) • Do not reveale the internal structure of the system • Are the best starting place for OO design …but… • Can be used in a non-OO development process • OO theory is not needed to understand to use them www. analisi-disegno. com Pag. 27

ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases Implementation requirements use cases object ÓAdriano Comai 1999 Introduzione ai casi d’uso Use Cases Implementation requirements use cases object oriented analysis and design structured analysis and design other methods (as you prefer) buy components www. analisi-disegno. com Pag. 28