sea side software engineering annotations annotation 13: use cases professor sara stoecklin director...

32
SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City [email protected] [email protected] 850-522-2091 850-522-2023 Ex 182 Florida State University Computer Science

Upload: joshua-cameron

Post on 01-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

SEA Side Software Engineering

AnnotationsAnnotation 13:

Use Cases

Professor Sara StoecklinDirector of Software Engineering- Panama City

[email protected]

[email protected]

850-522-2091

850-522-2023 Ex 182

Florida State University

Computer Science

               

Page 2: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu
Page 3: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

A method to represent the user interaction with the system in a manner than communicates with users that you understand the system scenarios (business).

Video Rental System

Rent video

Customer

Return video

CorporateOrder new videos

Page 4: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

USE CASES describe a sequence of actions (processes).

USE CASES graphically depict interactions between the system and external actors.

USE CASES identify high level services (processes, routines, methods).

USE CASES specify behavior.

USE CASES may have specialized use cases as extensions of generalized use cases.

Use Case Definition:

The specification of actions, including variant sequences and error sequences that a system, subsystem, or class can perform by interacting with outside actors.

Page 5: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Good way to begin defining the system through scenarios.

Test plan can be written from the users point of view with use cases.

Begins traceability.

Has extensions such as:

<<extends>> for extending the functionality of a use case

<<uses>> for using one use case within another and

<<includes>> for inner use cases and

<<calls>> for invocation of other use cases.

Page 6: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Difficult to determine the correct granularity.

Difficult to determine the correct use case.

Knowledge elicitation on use cases can cause an explosion of use cases.

Often too informal.

No techniques for diagramming polymorphic behavior.

Page 7: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

• Analyze requirements.• Design the use case.• Test use case.

Page 8: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

analysis model design model test/implement model

Video Rental System

Rent video

Rent video

Corporate

Order new videos

Order new videos

Order new videos

Order new videos

Video Rental System

Rent video

Rent video

Corporate

Order new videos

Order new videos

Order new videos

Order new videos

Rent video

Rent video

Rent video

Rent videoCuserC

ID()

Video Rental System

Rent video

Rent video

Corporate

Order new videos

Order new videos

Order new videos

Order new videos

Rent video

Rent video

Rent video

Rent video

Rent video

Page 9: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu
Page 10: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Video Rental System

Rent video

Customer

Return video

CorporateOrder new videos Use Case

Actor

System

SystemBoundary

Page 11: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Rent video

Customer

A use case may have many actorsAn Actor normally interacts with several use casesFor each actor you need to know how that actor uses the system.

Page 12: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Rent video

Customer

Defines 1..n actions triggered by the userRepresents an system partition (process?)Is built together with the user. Needs a description.

Page 13: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Narrative description Sequence Diagram as it interacts with objects.Collaboration Diagram between objects.States Diagrams

for more granularity.

Page 14: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Rent video

Customer

A use case description tells a user story.It contains events, actions, and states of objects.Described by the precondition, actions and post condition.defines 1..n actions triggered by the user

Page 15: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Rent video

Customer

Pre and Post conditions – define the values of a set of variables before and after the event triggers the actionsTrigger – event that stimulates the sequence of use case actionsActions – changes the values of the variables or as stated in OO – changes the states of the objects.

Page 16: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Rent video

Customer

CustomerVideo Rental System

Rent video

IdentifyValidate Identity

Identity is OK

Request movieValidate Request

Request is OK

MessageObject Operation path

Page 17: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Rent video

Customer

Customer

Rent video

1. Identify

2. Validate Identity

3. Identity is OK

Page 18: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Rent video

Customer

Identity Checking

Movie Request Checking

Wrapping Up

bad identity

Page 19: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Review and refine iteratively with each use case.Envision/describe/prototype each use case (user views).Release a version

when approved.

Page 20: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu
Page 21: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

analysis model design model test/implement model

Video Rental System

Rent video

Rent video

Corporate

Order new videos

Order new videos

Order new videos

Order new videos

Video Rental System

Rent video

Rent video

Corporate

Order new videos

Order new videos

Order new videos

Order new videos

Rent video

Rent video

Rent video

Rent video

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()Cus

erCID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

Video Rental System

Rent video

Customer

Rent video

Corporate

Order new videos

Order new videos

Order new videos

Order new videos

Rent video

Rent video

Rent video

Rent video

Rent video

Page 22: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

e

Rent videoRent video

Rent videoRent video

Rent videoRent video

Rent videoeRent video

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()Cuse

rCID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

CuserC

ID()

Customer

Interfaces

Packages

Frameworks

Architectural Patterns

Design Patterns

Page 23: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

2. Define the domain (conceptual) objects or classes of the system so domain rules (ex: business rules) can be encapsulated in these domain objects.

Page 24: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Video Rental System

attributes

methods

ClassName

Cassette

cassetteID: int

cassetteVolumeNo: int

rentMovie()

Customer

CID: int

name: String

authenticateCustomer ()

relationship

rents

1..*1..*

Multiplicity

Page 25: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Video Rental System

CassettecassetteID: int

cassetteVolumeNo: intrentMovie()

CustomerCID: int

name: StringauthenticateCustomer ()

RentalPrice\

dateofRental

ifAvail

1..*0..*1..11..10..*

Rental View Rental View Update Controller

Cassette Database

Rental Database

Customer Database

Page 26: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

CustomerVideo Rental System

Rent video

IdentifyValidate Identity

Identity is OK

Request movieValidate Request

Request is OK

Page 27: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Video Rental System

Customer

Rent video

IdentifyValidate Identity

Identity is OK

Request movieValidate Request

Request is OK

e

Customer

Identify

Validate IdentityIdentity is OK

Request movie

Request is OK

CustomerDatabase

CustomerCassetteDatabase Cassette

Validate Identity

Rental

Rent

Rental ViewController

Rental View

Validate IdentityGet Identity

Validate CassetteGet Cassette

Page 28: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Rent video

Customer

Identify

Validate IdentityIdentity is OK

Request movie

Request is OK

CustomerDatabase

CustomerCassetteDatabase Cassette

Validate Identity

Rental

Rent

Rental ViewController

Rental View

Validate IdentityGet Identity

Validate CassetteGet Cassette

Page 29: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu
Page 30: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Customer

Identify

Validate IdentityIdentity is OK

Request movie

Request is OK

CustomerDatabase

CustomerCassetteDatabase Cassette

Validate Identity

Rental

Rent

Rental ViewController

Rental View

Validate IdentityGet Identity

Validate CassetteGet Cassette

Rent video

Page 31: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

invalid customer

invalid database customer

valid database customer

valid customer

invalid cassette

valid cassette

Invalid database cassette

valid database cassette

Page 32: SEA Side Software Engineering Annotations Annotation 13: Use Cases Professor Sara Stoecklin Director of Software Engineering- Panama City sstoecklin@mail.pc.fsu.edu

Other Topics:

Use Case EngineeringUse Case SteroTypingUse Case Driven DesignResponsibility Driven Design