Presentation is loading. Please wait.

Presentation is loading. Please wait.

Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology.

Similar presentations


Presentation on theme: "Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology."— Presentation transcript:

1 Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology IT Department Software Engineering ESGD3110.101 & ITGD3103.101 1 st Semester 2008/2009 UP Copyrights 2008

2 Use Cases System Behavior Actors Use Cases Use Case Relationships Use Case Diagrams Activity Diagrams

3 System Behavior The behavior of the system under development (i.e., what functionality must be provided by the system) A use case model that illustrates the system's intended functions (use cases). A use case is a description of a system's behavior from a user's standpoint. It is valuable for gathering system’s requirements phase, analysis phase, development phase.

4 Use Case Model Use Case Model illustrates: – The system's intended functions (use cases) – Its surroundings (actors) – Relationships between the use cases and actors (use case diagrams). Use cases is a technique for capturing functional requirements of systems. Ask “what”, “when”, “why” questions

5 Simple Example Start up Shutdown Operator Generate Reports Order System View Order Status System Boundary

6 Actors Actors are not part of the system—they represent anyone or anything that must interact with the system. An actor may: – Only input information to the system – Only receive information from the system – Input and receive information to and from the system

7 Identifying System’s Actors Typically, these actors are found in the problem statement and by conversations with customers and domain experts. The following questions may be used to help identify the actors for a system: – Who is interested in a certain requirement? – Where in the organization is the system used? – Who will benefit from the use of the system?

8 Identifying System’s Actors (Cont.) – Who will supply the system with this information, use this information, and remove this information? – Who will support and maintain the system? – Does the system use an external resource? – Does one person play several different roles? – Do several people play the same role? – Does the system interact with a legacy system?

9 UML Notation for an Actor

10 What Constitutes a "Good" Actor? The first cut at the list of actors for a system is rarely the final list. – For example, is a new student a different actor than a returning student? Suppose you initially say the answer to this question is yes. The next step is to identify how the actor interacts with the system. If the new student uses the system differently than the returning student, they are different actors. If they use the system in the same way, they are the same actor.

11 Good Actor (Cont.) Another example is the creation of an actor for every role a person may play. This may also be overkill. – The teaching assistant in ESU takes classes and teaches classes. The capabilities needed to select courses to take and to teach are already captured by the identification of functionality needed by the Student and the Professor actors. Therefore, there is no need for a Teaching Assistant actor.

12 Actors in the ESU Course Registration System An actor is someone or some thing that must interact with the system under development StudentRegistrarProfessorBilling System

13 Use Cases Use cases model a dialogue between an actor and the system. They represent the functionality provided by the system; that is, what capabilities will be provided to an actor by the system. The collection of use cases for a system constitute all the defined ways the system may be used.

14 Use Cases (Cont.) The formal definition for a use case is: A use case is a sequence of transactions performed by a system that yields a measurable result of values for a particular actor. A use case defines a goal-oriented set of interactions between external actors and the system under consideration.

15 Identifying System’s Use Cases What are the tasks of each actor? Will any actor create, store, change, remove, or read information in the system? What use case will create, store, change, remove, or read this information? Will any actor need to inform the system about sudden, external changes? Does any actor need to be informed about certain occurrences in the system? What use cases will support and maintain the system? Can all functional requirements be performed by the use cases?

16 UML Notation for a Use Case

17 What Constitutes a "Good" Use Case? The problem is the level of detail found in use cases. How big (or how little) should they be? There is no one, right answer.

18 Use Cases: Rule of The Thumbs A use case typically represents a major piece of functionality that is complete from beginning to end. A use case must deliver something of value to an actor. A use case must achieve the actor’s goal.

19 Use Case Details?: ATM Example

20

21

22 Use Case Details?: ESU Example

23

24

25 After Finding System Actors? Now What? The next step is to look at each actor and see how they use the system. This is the initial set of use cases. A use case is a sequence of transactions a system performs that yields an observable result of value to a particular actor. In other words, it is a chunk of functionality.

26 Use Cases in the ESU Course Registration System A use case is a pattern of behavior the system exhibits – Each use case is a sequence of related transactions performed by an actor and the system in a dialogue Actors are examined to determine their needs – Registrar -- maintain the curriculum – Professor -- request roster – Student -- maintain schedule – Billing System -- receive billing information from registration Maintain ScheduleMaintain CurriculumRequest Course Roster

27 Use Cases in the ESU Course Registration System Based on these needs, the following use cases have been identified: – Register for courses – Select courses to teach – Request course roster – Maintain course information – Maintain professor information – Maintain student information – Create course catalog

28 Documenting Use Cases A flow of events document is created for each use cases. It is a textual description of what must happen to achieve the desired functionality of the use case. – Written from an actor point of view Details what the system must provide to the actor when the use cases is executed Typical contents – How the use case starts and ends – Normal flow of events – Alternate flow of events – Exceptional flow of events

29 Flow of Events (Count.) The flow of events usually contains the following information: – Who starts the use case (I.e. what actor) – How the use case ends – The normal flow (I.e. the happy day scenario -- all works well) – Any identified alternate flows (I.e. What happens when different options are selected) – finally any exceptional flows (the what happens if … scenarios). It is important to start to think about the exceptional flows early in analysis -- this determines what risks will be mitigated by the system since not ALL risks will be taken care of by the software.

30 Maintain Curriculum Flow of Events This use case begins when the Registrar logs onto the Registration System and enters his/her password. The system verifies that the password is valid (E-1) and prompts the Registrar to select the current semester or a future semester (E-2). The Registrar enters the desired semester. The system prompts the professor to select the desired activity: ADD, DELETE, REVIEW, or QUIT. If the activity selected is ADD, the S-1: Add a Course subflow is performed. If the activity selected is DELETE, the S-2: Delete a Course subflow is performed. If the activity selected is REVIEW, the S-3: Review Curriculum subflow is performed. If the activity selected is QUIT, the use case ends....

31 Use Case Docs Template 1.0 Use Case Name 1.1 Brief Description 2.0 Flow of Events 2.1 Basic Flow 2.2 Alternate Flows 2.2.x 3.0 Special Requirements 3.x 4.0 Preconditions 4.x 5.0 Post Conditions 5.x 6.0 Extension Points 6.x

32 Use Case Relationships An association relationship may exist between an actor and a use case. This type of association is often referred to as a communicate association since it represents communication between an actor and a use case. An association may be navigable: – In both directions (actor to use case and use case to actor) – in only one direction (actor to use case or use case to actor).

33 Use Case Relationships The navigation direction of an association represents who is initiating the communication – the actor is initiating the communication with the use case – the use case is initiating the communication with the actor).

34 Include Relationship Include relationships are created between the new use case and any other use case that "uses" its functionality. An include relationship is drawn as a dependency relationship that points from the base use case to the used use case.

35 Extend relationship An extend relationship is used to show: – Optional behavior – Behavior that is run only under certain conditions such as triggering an alarm – Several different flows that may be run based on actor selection

36 Communicate, Include, and Extend relationships

37 Use Case Diagrams Describe what the system does from the view of an external observer. Use cases represent scenarios of what could happen to the system. A Use Case is a summary of a scenario of some related tasks A use case diagram is a graphical view of some or all of the actors, use cases, and their interactions identified for a system.

38 Use Case Diagrams Each system typically has a Main Use Case diagram, which is a picture of the system boundary (actors) and the major functionality provided by the system (use cases). Other use case diagrams may be created as needed. Some examples follow: – A diagram showing all the use cases for a selected actor – A diagram showing all the use cases being implemented in an iteration – A diagram showing a use case and all its relationships

39 The Use Case toolbar in Rational Rose Package Use Case Actor Message Dependency Generalization

40 Use Case Diagram in the ESU Course Registration System Registrar Professor Maintain Schedule Maintain Curriculum Request Course Roster Student Billing System

41 Use Case Diagram in the ESU Course Registration System

42

43 Use Case: Clinic System Example A Use Case diagram is a summary of Use Cases

44 Use Case: Clinic System Example

45 Use Case diagrams show the system boundaries. Generalization: one is a special kind of the other Includes: one invokes the other Extend: one is a variation of the other

46 Activity Diagram Activity diagrams show flow of control Select courses to teach Create curriculum Create catalog Place catalog in bookstore Open registration Close registration [ Registration time period expired ] Mail catalog to students

47 Swimlanes RegistrarProfessor Select courses to teach Create curriculum Create catalog Place catalog in bookstore Open registration Close registration [ Registration time period expired ] Mail catalog to students


Download ppt "Faculty of Applied Engineering and Urban Planning Software Engineering Department Software Engineering Lab Use Cases Faculty of Information system Technology."

Similar presentations


Ads by Google