CSCE 492 Software Engineering Lecture 3 Uses Cases

  • Slides: 28
Download presentation
CSCE 492 Software Engineering Lecture 3 Uses Cases Topics n UML Use Cases pop

CSCE 492 Software Engineering Lecture 3 Uses Cases Topics n UML Use Cases pop quiz Readings: Chapter 3 January 24, 2008

Overview Last Time n Corrections to slides: l Added spiral model figure 492 Website/Resources/Spiral.

Overview Last Time n Corrections to slides: l Added spiral model figure 492 Website/Resources/Spiral. Model. Boehm. pdf l Rational Unified Process, Extreme Programming XP l Model Driven Architecture n Pragmatics l UML references, Teams n Models for the process of software development l Waterfall model, Spiral model, Agile, n Requirements Today’s Lecture n n UML review Requirements References: n n Chapters 3 of the text http: //www. omg. org/, http: //www. holub. com/goodies/uml/ Next Time: – 2– CSCE 492 Spring 2008

UML – Unified Modeling Language UML references n http: //www. holub. com/goodies/uml/ n http:

UML – Unified Modeling Language UML references n http: //www. holub. com/goodies/uml/ n http: //www. uml. org/ Poseidon tool for UML n http: //gentleware. com/index. php Website of Quick Reference Cards n – 3– http: //www. digilife. be/quickreferences/quickrefs. htm CSCE 492 Spring 2008

What's new in UML 2. 0 l Nested Classifiers: In UML 2. 0, you

What's new in UML 2. 0 l Nested Classifiers: In UML 2. 0, you can nest a set of classes inside the component that manages them, or embed a behavior (such as a state machine) inside the class or component that implements it. l Improved Behavioral Modeling: l Improved relationship between Structural and Behavioral Models: – 4– CSCE 492 Spring 2008

Verifying Requirements A structured walkthrough with the end users is a good technique for

Verifying Requirements A structured walkthrough with the end users is a good technique for ensuring that the user needs are being addressed To ensure that the resulting software supports the requirements specification, items on the supported activity list are numbered and propagated through the software models and source code – 5– CSCE 492 Spring 2008

The Process of Requirements Analysis l Create verified requirements specification l Create list of

The Process of Requirements Analysis l Create verified requirements specification l Create list of primary classes l Create informal scenarios l Create use cases l Create scenarios l Create class diagrams l Create use case diagrams – 6– CSCE 492 Spring 2008

Determining Primary Classes Select nouns from the requirements specification and inspect each noun for

Determining Primary Classes Select nouns from the requirements specification and inspect each noun for the following properties l Retained information l Needed services l Multiple attributes l Common operations l Essential requirements – 7– CSCE 492 Spring 2008

LMS Case Study: Primary Classes l Patron l Student, faculty, library staff l Resource

LMS Case Study: Primary Classes l Patron l Student, faculty, library staff l Resource l Book, music CD, video, software l Reference resource, reserved resource, requested resource, online research resource l Inter-library loan request l Overdue charge l Overdue form letters – 8– CSCE 492 Spring 2008

Identifying Use Cases l A use case is a description of a scenario (or

Identifying Use Cases l A use case is a description of a scenario (or closely related set of scenarios) in which the system interacts with users of the system l The behavior of the system is expressed without specifying how the behavior is implemented l Use cases are initially described as a narrative, and then modeled graphically by class diagrams and interaction diagrams (to be discuss later) l Informal scenarios are a good starting point for use cases – 9– CSCE 492 Spring 2008

Characteristics of Use Cases l Use cases are more abstract than informal scenarios l

Characteristics of Use Cases l Use cases are more abstract than informal scenarios l A single use case may encompass multiple scenarios l Use cases avoid redundancy l Use cases are more formally structured than scenarios l Use cases seek to capture complete breadth of system behavior – 10 – CSCE 492 Spring 2008

Use Case Layout l Precondition n What conditions must be true at the beginning

Use Case Layout l Precondition n What conditions must be true at the beginning of the use case? l Main flow of events n Describe the essential behavior associated with the use case l Post condition n What occurs as a result of the use case executing l Exceptional flow of events ( zero to many) n – 11 – Enumerate possible erroneous flow of events CSCE 492 Spring 2008

LMS Case Study: Use Cases Validate patron Check out resource Check in resource Request

LMS Case Study: Use Cases Validate patron Check out resource Check in resource Request resource Reserve resource Manage Resource Manage Patron Generate form letter – 12 – CSCE 492 Spring 2008

LMS Case Study: Check out Resource Use Case Precondition n n Library staff and

LMS Case Study: Check out Resource Use Case Precondition n n Library staff and patron validated to LMS Library DB initialized Main flow of events n n Enter resource Determine due date Exceptional flow of events n n n – 13 – Patron ID not valid Patron has over due resources or too many checked Resource number not valid CSCE 492 Spring 2008

More LMS Case Study: Check out Resource Use Case Postcondition Patron DB entry updated

More LMS Case Study: Check out Resource Use Case Postcondition Patron DB entry updated to reflect new resource n Resource DB entry updated to reflect changed status: checked out n Due date assigned to the resource DB entry n – 14 – CSCE 492 Spring 2008

Scenario Development l Scenarios are derived from use cases l Scenarios are like informal

Scenario Development l Scenarios are derived from use cases l Scenarios are like informal scenarios, but are more formally structured l Informal scenarios may be modified to produce scenarios l Use cases are abstract because they do not reference specific values l Scenarios are concrete because they do reference specific values l Multiple scenarios may be required for a single use case – 15 – CSCE 492 Spring 2008

Modeling the System with UML The process of modeling parallels and supports the process

Modeling the System with UML The process of modeling parallels and supports the process of understanding the system requirements Two types of models support the analysis process Class diagrams n Use case diagrams n – 16 – CSCE 492 Spring 2008

Class Diagrams Models the composition of classes and the essential relationships between classes Models

Class Diagrams Models the composition of classes and the essential relationships between classes Models a static perspective of the system May expresses a more or less abstract representation of the system The notational building blocks n n – 17 – Classes Interfaces Relationships Collaborations CSCE 492 Spring 2008

Notational Elements of Class Diagrams Class Detailed Class Interface Class Name Relationships: Dependency Collaboration

Notational Elements of Class Diagrams Class Detailed Class Interface Class Name Relationships: Dependency Collaboration Association Generalization Collaboration Name – 18 – CSCE 492 Spring 2008

LMS Case Study: Class Diagram Requests Checks out lists c Overdue form Letter generates

LMS Case Study: Class Diagram Requests Checks out lists c Overdue form Letter generates – 19 – Resource Browses Returns es s e t le ves e d el h res ad d o pr s es s Patron Library staff CSCE 492 Spring 2008

LMS Case Study: Class Diagram for Check out Resource Library staff Patron processes Checks

LMS Case Study: Class Diagram for Check out Resource Library staff Patron processes Checks out Resource Software – 20 – Video Book Music CD CSCE 492 Spring 2008

Use Case Diagrams Use case diagrams depict use cases interacting with external actors External

Use Case Diagrams Use case diagrams depict use cases interacting with external actors External actors are entities that interact with the software system, like system users, databases, or books Use cases represent system requirements and show a functional partitioning of the system Functional partitioning is useful for a dividing a system into smaller pieces – 21 – CSCE 492 Spring 2008

Notational Elements of Use Case Diagrams Actor Use case name Relationships: Dependency – 22

Notational Elements of Use Case Diagrams Actor Use case name Relationships: Dependency – 22 – Association Generalization CSCE 492 Spring 2008

LMS Case Study: Use Case Diagram Browse Resource Request Resource Patron – 23 –

LMS Case Study: Use Case Diagram Browse Resource Request Resource Patron – 23 – Reserve Resource CSCE 492 Spring 2008

Steps in UCCD Analysis Process Use Case Centered Design (UCCD) Process l Create/refine requirements

Steps in UCCD Analysis Process Use Case Centered Design (UCCD) Process l Create/refine requirements specification l Create informal scenarios n brainstorm with stakeholders l Create list of primary classes l Create use cases l Create scenarios from use cases l Create class diagrams showing basic inter-class relationships l Model key class collaborations l Create use case diagrams – 24 – CSCE 492 Spring 2008

Evolving the System Requirements analysis may be done iteratively throughout system development The system

Evolving the System Requirements analysis may be done iteratively throughout system development The system to be developed may be partitioned into development subgoals Each subgoal has its own requirements analysis phase that it followed by design, implementation, and testing Each subset of the system is made work before the next subgoal is analyzed – 25 – CSCE 492 Spring 2008

Analyzing the Class Project List the primary classes Create a basic class diagram showing

Analyzing the Class Project List the primary classes Create a basic class diagram showing aggregation and inheritance Create use cases Create class diagrams Create use case diagrams Create one or more scenarios for each use case Engage in a structured walkthrough with your customer – 26 – CSCE 492 Spring 2008

Working in Teams Development teams should meet at least once a week A common

Working in Teams Development teams should meet at least once a week A common list of primary classes should be created by the team The creation of use cases, class diagrams, and scenarios should be divided amongst development team members The team as a whole should review the individual products to ensure that the pieces fit together – 27 – CSCE 492 Spring 2008

Additional Pointers for Effective Team Work The role of the chair is to facilitate

Additional Pointers for Effective Team Work The role of the chair is to facilitate discussion Each team member should have equal opportunity to be heard The meeting chair to make an extra effort to hear from less aggressive team members Team members should not be interrupted unless they are being long-winded Everyone should strive to make their points as concisely as possible – 28 – CSCE 492 Spring 2008