SlideShare a Scribd company logo
1
NJIT
Use Cases
Supplemental Lecture for
Chapter 2 of Xiaoping Jia
OOSD using Java
2
Define the Problem
 The most critical question:
 “Is this the right system to make?”
3
Use Case Relationships
Domain Model
Use Case Model
Interaction Diagrams
Design
Requirements
Business Model
Objects, attributes, associations
VISION
GLOSSARY
SUPPLEMENTARY
SPECIFICATION
4
Use Cases are not Diagrams
 Use Cases may have a diagram associated
with them, and a use case diagram is an
easy way for an analyst to discuss a
process with a subject matter expert (SME).
 But use cases are primarily text. The text is
important. The diagram is optional.
5
Emphasize Goals
 Investigating goals rather than tasks and
procedures improves information gathering
by focusing on the essence of requirements
—the intent behind them.
 Seeing requirements as identifying tasks to
be done has a strong bias toward
reproducing the existing system, even when
it is being replaced because it is seriously
defective.
6
Why Use Cases?
 Simple and familiar storytelling makes it
easier, especially for customers, to
contribute and review goals.
 Use cases keep it simple (KISS)
 They emphasize goals and the user
perspective.
 New use case writers tend to take them too
seriously.
7
Actors or Use Case First?
 Because you have to understand each part of
Use Cases, the parts are presented separately.
But those who create use cases switch back and
forth. The text describes use cases substantially
before paying attention to actors. Typically, both
actors and use cases are identified early and
then examined to see if more use cases can be
found from the actors, or more actors found by
examining the use cases.
8
Identify Use Cases
 Capture the specific ways of using the
system as dialogues between an actor
and the system.
 Use cases are used to
 Capture system requirements
 Communicate with end users and Subject
Matter Experts
 Test the system
9
Specifying Use Cases
 Create a written document for each Use Case
 Clearly define intent of the Use Case
 Define Main Success Scenario (Happy Path)
 Define any alternate action paths
 Use format of Stimulus: Response
 Each specification must be testable
 Write from actor’s perspective, in actor’s
vocabulary
10
www.usecases.org Template
 Name
 Primary Actor
 Scope
 Level
 Stakeholders and
Interests
 Minimal Guarantee
 Success Guarantee
 Main Success Scenario
 Extensions
 This is the basic format used
in the text and in Alistair
Cockburn’s Writing Effective
Use Cases (Addison Wesley,
2000, ISBN 0201702258).
 I prefer to modify it slightly to
use the actor actions and
system response in tabular
form. Larman calls this the
Two-Column Variation.
11
Optional Items
 You can add some of the following items
 Trigger (after Success Guarantee)
 (at end:)
 Special requirements
 Technology and Data Variations
 Frequency of Occurrence
 Open Issues
12
SAMPLE:
Fully
Dressed
Use
Case
13
Elements in the Preface
 Only put items that are important to
understand before reading the Main
Success Scenario. These might include:
 Name (Always needed for identification)
 Primary Actor
 Stakeholders and Interests List
 Preconditions
 Success Conditions (Post Conditions)
14
Naming Use Cases
 Must be a complete process from the
viewpoint of the end user.
 Usually in verb-object form, like Buy Pizza
 Use enough detail to make it specific
 Use active voice, not passive
 From viewpoint of the actor, not the
system
15
Hint
 Appropriate use case names are very important.
Because they are selected early, they tend to set
the direction for the entire project.
 Most common errors in use case diagrams are
poor names, showing procedures instead of
complete user processes, and not including the
boundary and system name.
 Rational Rose does not show the boundary and
name, so assignments turned in using that tool do
not have to have them. Rational Rose is preferred
for assignments.
16
Golden Rule of Use-Case
Names
 Each use case should have a name that
indicates what value (or goal) is achieved by
the actor's interaction with the system
 Here are some good questions to help you
adhere to this rule:
 Why would the actor initiate this interaction
with the system?
What goal does the actor have in mind when
undertaking these actions?
What value is achieved and for which actor?
From Dr. Use Case (Leslee Probasco) in the Rational Edge, March, 2001
17
Use Case Name Examples
 Excellent - Purchase Concert Ticket
 Very Good - Purchase Concert Tickets
 Good - Purchase Ticket (insufficient detail)
 Fair - Ticket Purchase (passive)
 Poor - Ticket Order (system view, not user)
 Unacceptable - Pay for Ticket (procedure,
not process)
18
CRUD
 Examples of bad use case names with the
acronym CRUD. (All are procedural and
reveal nothing about the actor’s
intentions.)
 C - actor Creates data
 R - actor Retrieves data
 U - actor Updates data
 D - actor Deletes data
19
Singular or Plural
 This is usually determined by context.
 There is a preference for the simplest form, but
most common form can be better.
 In the example of concert tickets, most people
buy more than one, but a significant number buy
only one.
 At a supermarket, Buy Items would be best.
 At a vending machine, it would be Buy Item.
20
Identify Actors
 We cannot understand a system until we
know who will use it
 Direct users
 Users responsible to operate and maintain it
 External systems used by the system
 External systems that interact with the system
21
Specifying Actors
 Actors are external to the system
 Actors are non-deterministic
 What interacts with the system?
 Actors may be different roles that one
individual user interacts with the system
 Actors may be other systems
 Don’t assume that Actor = Individual
22
Types of Actors
 Primary Actor
 Has goals to be fulfilled by system
 Supporting Actor
 Provides service to the system
 Offstage Actor
 Interested in the behavior, but no contribution
 In diagrams, Primary actors go on the left and
others on the right.
23
Define Actors
 Actors should not be analyzed or described in detail
unless the application domain demands it.
 Template for definition:
 Name
 Definition
 Example for an ATM application:
Customer: Owner of an account who manages account by
depositing and withdrawing funds
24
Identifying Actors
 Primary Actor
 Emphasis is on the primary actor for the
use case.
 Stakeholders and Interests
 Other actors are listed as stakeholders.
 The interests of each key actor should
be described.
25
Working with Use Cases
 Determine the actors that will interact with
the system
 Examine the actors and document their
needs
 For each separate need, create a use
case
 During Analysis, extend use cases with
interaction diagrams
26
Preconditions
 Anything that must always be true before
beginning a scenario is a precondition.
 Preconditions are assumed to be true, not
tested within the Use Case itself.
 Ignore obvious preconditions such as the
power being turned on. Only document
items necessary to understand the Use
Case.
27
Success Guarantees
 Success Guarantees (or Postconditions)
state what must be true if the Use Case is
completed successfully. This may include
the main success scenario and some
alternative paths. For example, if the happy
path is a cash sale, a credit sale might also
be regarded a success.
 Stakeholders should agree on the guarantee.
28
Scenarios
 The Main Success Scenario, or “happy
path” is the expected primary use of the
system, without problems or exceptions.
 Alternative Scenarios or Extensions are
used to document other common paths
through the system and error handling or
exceptions.
29
Documenting the Happy Path
 The Success Scenario (or basic course) gives the best
understanding of the use case
 Each step contains the activities and inputs of the actor and
the system response
 If there are three or more items, create a list
 Label steps for configuration management and requirements
traceability
 Use present tense and active voice
 Remember that User Interface designers will use this
specification
Note: Do not use the term “happy path” in formal documents.
30
Extensions (Alternative Flows)
 Extensions or Alternative Flow Use Cases
allow the specification of
 Different ways of handling transactions
 Error processes
 Sections are convenient way to handle
alternative courses of action
 Sections are a segment of a use case
executed out of sequence
31
Two Parts for Extensions
 Condition
 Describe the reason for the alternative
flow as a condition that the user can
detect
 Handling
 Describe the flow of processing in the
same manner as the happy path, using
a numbering system consistent with the
original section.
32
Documenting Extensions
 Use same format as Happy Path
 Document actions that vary from ideal path
 Include error conditions
 Number each alternate, and start with the
condition:
3A. Condition: If [actor] performs [action] the system …
 If subsequent steps are the same as the happy
path, identify and label as (same)
 Steps not included in alternate course are
assumed not to be performed.
33
Special Requirements
 If a non-functional requirement , quality
attribute, or constraint affects a use case
directly, describe it as a special
requirement.
34
Types of Use Cases
 The most common Use Cases are High
Level Use Cases and Expanded Essential
Use Cases in analysis, and Expanded
Real Use Cases in design. The next slide
gives definitions.
 In addition, Use Case diagrams may be
used in discussions with stakeholders
while capturing their requirements.
35
Elaborating Use Cases
 High Level Use Case (Brief)
 Name, Actors, Purpose, Overview
 Expanded Use Case (Fully Dressed)
 Add System Events and System Responses
 Essential Use Case (Black Box)
 Leave out technological implications
 Real Use Case (White Box)
 Leave in technology
36
Expanded Essential Use Cases
(Fully Dressed Use Cases)
 Purpose:
 to allow the system designer and client to visualize the flow of actor
actions and system responses. From this the client will understand
how users will use the system, and the designer will be able to write
pseudocode for each function. In addition, it is possible to use this
document to anticipate opportunities for user error, which must be
accounted for in the final system.
 Definitions:
 What it is: an analysis document which describes in detail the
elements of functions identified in a High Level Use Case.
 What is is not: Expanded Essential Use Cases are not graphical
drawings. They do not include stick figures, boxes representing the
system, or any other icons found in a High Level Use Case although
they may be associated with one.
37
Expanded Essential
Use Cases
 How to make one:
 Step 1: Name the Use Case (system function, e.g. “enter
timesheet information”).
 Step 2: Identify the Actor(s) involved.
 Step 3: Describe the Intent of the Use Case in language the client
will understand.
 Step 4: Identify the Assumptions and Limitations relevant to this
Use Case and other Use Cases which the current one might
extend or build upon.
 Step 5: Specify the ideal flow of actions using two columns
labeled “Actor Actions” and “System Responses.” Number each
step. This constitutes the Happy Path for this Use Case.
 Step 6: Identify opportunities for user error and create an
Alternative Path to handle each.
38
Postconditions
 Postconditions (or success guarantees)
state what always must be true for a use
case to succeed. Avoid the obvious, but
clearly document any that are not obvious.
This is one of the most important parts of
a use case.
39
Conditions and Branching
 Stick to the “Happy Path,” “Sunny Day
Scenario,” Typical Flow, or Basic Flow (all
names for the same basic idea) in the
main section and defer all conditional
sections and branching to the extensions
or alternate flows.
40
Warning
 Use cases should not be misused to imitate
function specification by successive iteration
 Don’t refine them until the program is fully
specified
 The uses relation should only be used when
the same scenario is encountered more
than once
41
Use Cases not an OO idea
 Use Cases are not an Object-Oriented
methodology. They are common in
structured development as well.
 However, the Unified Process encourages
use-case driven development.
42
Use case levels
 User-goal level
 A complete process from the view point of a
user to meet a goal of the user, roughly
corresponding to an elementary business
process.
 Subfunction level
 Details steps to support a user goal.
43
Use-case driven development
 Requirements are primarily recorded in
the Use Case model.
 Iterations are planned around
implementing particular Use Cases.
 Use Case Realizations drive design.
 Use Case often influence the way user
manuals are organized.
44
Use Cases are always wrong!
 Written documentation gives the illusion of
authority and correctness, but it is an illusion.
 Use cases give a preliminary understanding that
users and developers can discuss and agree on.
 But there should be constant feedback from
customers in the development process to correct
missing information and misinformation before it
jeopardizes the functionality of the program.
45
Bibliography
 http://members.aol.com/acockburn/papers
/AltIntro.htm
 http://www.usecases.org/
Ad

More Related Content

Similar to UseCase.ppt software engineering use3 cases (20)

Lecture7 use case modeling
Lecture7 use case modelingLecture7 use case modeling
Lecture7 use case modeling
Shahid Riaz
 
Requirements Are Optional, Right?
Requirements Are Optional, Right?Requirements Are Optional, Right?
Requirements Are Optional, Right?
thomstrat
 
Use-Case-Diagram.ppt
Use-Case-Diagram.pptUse-Case-Diagram.ppt
Use-Case-Diagram.ppt
FarHana74914
 
Unified Modeling Language: Use case Diagrams in Software engineering
Unified Modeling Language: Use case Diagrams in Software engineeringUnified Modeling Language: Use case Diagrams in Software engineering
Unified Modeling Language: Use case Diagrams in Software engineering
NabeelRehman21
 
SE18_Lec 09_UML Use Cases
SE18_Lec 09_UML Use CasesSE18_Lec 09_UML Use Cases
SE18_Lec 09_UML Use Cases
Amr E. Mohamed
 
6. ch 5-understanding requirements
6. ch 5-understanding requirements6. ch 5-understanding requirements
6. ch 5-understanding requirements
Delowar hossain
 
6-180117160306. software engineering concepts
6-180117160306. software engineering concepts6-180117160306. software engineering concepts
6-180117160306. software engineering concepts
NMahendiran
 
Use Case UML Diagram
Use Case UML DiagramUse Case UML Diagram
Use Case UML Diagram
University of Texas at Dallas
 
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Dr Sukhpal Singh Gill
 
Ch07
Ch07Ch07
Ch07
guest50f28c
 
Ch07
Ch07Ch07
Ch07
Humberto Bruno Pontes Silva
 
Lesson02_Use Case Diagrams
Lesson02_Use Case DiagramsLesson02_Use Case Diagrams
Lesson02_Use Case Diagrams
Marwa Ali Eissa
 
Software System Engineering - Chapter 9
Software System Engineering - Chapter 9Software System Engineering - Chapter 9
Software System Engineering - Chapter 9
Fadhil Ismail
 
Data Flow Diagram and USe Case Diagram
Data Flow Diagram and USe Case DiagramData Flow Diagram and USe Case Diagram
Data Flow Diagram and USe Case Diagram
Kumar
 
02-use_cases in Unified modeling languages
02-use_cases in Unified modeling languages02-use_cases in Unified modeling languages
02-use_cases in Unified modeling languages
NALESVPMEngg
 
Use Case Modeling in Software Development: A Survey and Taxonomy
Use Case Modeling in Software Development: A Survey and TaxonomyUse Case Modeling in Software Development: A Survey and Taxonomy
Use Case Modeling in Software Development: A Survey and Taxonomy
Eswar Publications
 
Sadcw 7e chapter03-done(1)
Sadcw 7e chapter03-done(1)Sadcw 7e chapter03-done(1)
Sadcw 7e chapter03-done(1)
LamineKaba6
 
Building an Information System
Building an Information SystemBuilding an Information System
Building an Information System
Jo Balucanag - Bitonio
 
Defining The System
Defining The SystemDefining The System
Defining The System
Sandeep Ganji
 
Use Case Workshop
Use Case WorkshopUse Case Workshop
Use Case Workshop
elkensteyin
 
Lecture7 use case modeling
Lecture7 use case modelingLecture7 use case modeling
Lecture7 use case modeling
Shahid Riaz
 
Requirements Are Optional, Right?
Requirements Are Optional, Right?Requirements Are Optional, Right?
Requirements Are Optional, Right?
thomstrat
 
Use-Case-Diagram.ppt
Use-Case-Diagram.pptUse-Case-Diagram.ppt
Use-Case-Diagram.ppt
FarHana74914
 
Unified Modeling Language: Use case Diagrams in Software engineering
Unified Modeling Language: Use case Diagrams in Software engineeringUnified Modeling Language: Use case Diagrams in Software engineering
Unified Modeling Language: Use case Diagrams in Software engineering
NabeelRehman21
 
SE18_Lec 09_UML Use Cases
SE18_Lec 09_UML Use CasesSE18_Lec 09_UML Use Cases
SE18_Lec 09_UML Use Cases
Amr E. Mohamed
 
6. ch 5-understanding requirements
6. ch 5-understanding requirements6. ch 5-understanding requirements
6. ch 5-understanding requirements
Delowar hossain
 
6-180117160306. software engineering concepts
6-180117160306. software engineering concepts6-180117160306. software engineering concepts
6-180117160306. software engineering concepts
NMahendiran
 
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Dr Sukhpal Singh Gill
 
Lesson02_Use Case Diagrams
Lesson02_Use Case DiagramsLesson02_Use Case Diagrams
Lesson02_Use Case Diagrams
Marwa Ali Eissa
 
Software System Engineering - Chapter 9
Software System Engineering - Chapter 9Software System Engineering - Chapter 9
Software System Engineering - Chapter 9
Fadhil Ismail
 
Data Flow Diagram and USe Case Diagram
Data Flow Diagram and USe Case DiagramData Flow Diagram and USe Case Diagram
Data Flow Diagram and USe Case Diagram
Kumar
 
02-use_cases in Unified modeling languages
02-use_cases in Unified modeling languages02-use_cases in Unified modeling languages
02-use_cases in Unified modeling languages
NALESVPMEngg
 
Use Case Modeling in Software Development: A Survey and Taxonomy
Use Case Modeling in Software Development: A Survey and TaxonomyUse Case Modeling in Software Development: A Survey and Taxonomy
Use Case Modeling in Software Development: A Survey and Taxonomy
Eswar Publications
 
Sadcw 7e chapter03-done(1)
Sadcw 7e chapter03-done(1)Sadcw 7e chapter03-done(1)
Sadcw 7e chapter03-done(1)
LamineKaba6
 
Use Case Workshop
Use Case WorkshopUse Case Workshop
Use Case Workshop
elkensteyin
 

More from kavitamittal18 (20)

11MappingDesigntoCode.ppt Software engineering
11MappingDesigntoCode.ppt Software engineering11MappingDesigntoCode.ppt Software engineering
11MappingDesigntoCode.ppt Software engineering
kavitamittal18
 
11MappingDesigntoCode.ppt ooad software software
11MappingDesigntoCode.ppt ooad software  software11MappingDesigntoCode.ppt ooad software  software
11MappingDesigntoCode.ppt ooad software software
kavitamittal18
 
Introduction.ppt wireless
Introduction.ppt                    wirelessIntroduction.ppt                    wireless
Introduction.ppt wireless
kavitamittal18
 
CellularNetworks.ppt ppt
CellularNetworks.ppt                                     pptCellularNetworks.ppt                                     ppt
CellularNetworks.ppt ppt
kavitamittal18
 
Dr.C S Prasanth-Physics ppt.pptx computer
Dr.C S Prasanth-Physics ppt.pptx computerDr.C S Prasanth-Physics ppt.pptx computer
Dr.C S Prasanth-Physics ppt.pptx computer
kavitamittal18
 
CSL101_Ch1.ppt Computer Science
CSL101_Ch1.ppt          Computer ScienceCSL101_Ch1.ppt          Computer Science
CSL101_Ch1.ppt Computer Science
kavitamittal18
 
maincse-150510153437-lva1-app68Computer Science92.ppt
maincse-150510153437-lva1-app68Computer Science92.pptmaincse-150510153437-lva1-app68Computer Science92.ppt
maincse-150510153437-lva1-app68Computer Science92.ppt
kavitamittal18
 
Programming language basics.ppt Computer Science
Programming language basics.ppt Computer ScienceProgramming language basics.ppt Computer Science
Programming language basics.ppt Computer Science
kavitamittal18
 
02-chapter-1.ppt programming languages 10
02-chapter-1.ppt programming languages 1002-chapter-1.ppt programming languages 10
02-chapter-1.ppt programming languages 10
kavitamittal18
 
CS553_ST7_Ch14-CellularWirelessNetworks.ppt
CS553_ST7_Ch14-CellularWirelessNetworks.pptCS553_ST7_Ch14-CellularWirelessNetworks.ppt
CS553_ST7_Ch14-CellularWirelessNetworks.ppt
kavitamittal18
 
Lec7!JavaThreads.ppt java multithreading
Lec7!JavaThreads.ppt java multithreadingLec7!JavaThreads.ppt java multithreading
Lec7!JavaThreads.ppt java multithreading
kavitamittal18
 
JDBC.ppt database connectivity in java ppt
JDBC.ppt database connectivity in java pptJDBC.ppt database connectivity in java ppt
JDBC.ppt database connectivity in java ppt
kavitamittal18
 
chapter7.ppt java programming lecture notes
chapter7.ppt java programming lecture noteschapter7.ppt java programming lecture notes
chapter7.ppt java programming lecture notes
kavitamittal18
 
09slide.ppt oops classes and objects concept
09slide.ppt oops classes and objects concept09slide.ppt oops classes and objects concept
09slide.ppt oops classes and objects concept
kavitamittal18
 
480 GPS Tech mobile computing presentation
480 GPS Tech mobile computing presentation480 GPS Tech mobile computing presentation
480 GPS Tech mobile computing presentation
kavitamittal18
 
gsm-archtecture.ppt mobile computing ppt
gsm-archtecture.ppt mobile computing pptgsm-archtecture.ppt mobile computing ppt
gsm-archtecture.ppt mobile computing ppt
kavitamittal18
 
AdHocTutorial.ppt
AdHocTutorial.pptAdHocTutorial.ppt
AdHocTutorial.ppt
kavitamittal18
 
ELECTORAL POLITICS KAMAL PPT.pptx
ELECTORAL POLITICS KAMAL PPT.pptxELECTORAL POLITICS KAMAL PPT.pptx
ELECTORAL POLITICS KAMAL PPT.pptx
kavitamittal18
 
java_lect_03-2.ppt
java_lect_03-2.pptjava_lect_03-2.ppt
java_lect_03-2.ppt
kavitamittal18
 
Input and Output.pptx
Input and Output.pptxInput and Output.pptx
Input and Output.pptx
kavitamittal18
 
11MappingDesigntoCode.ppt Software engineering
11MappingDesigntoCode.ppt Software engineering11MappingDesigntoCode.ppt Software engineering
11MappingDesigntoCode.ppt Software engineering
kavitamittal18
 
11MappingDesigntoCode.ppt ooad software software
11MappingDesigntoCode.ppt ooad software  software11MappingDesigntoCode.ppt ooad software  software
11MappingDesigntoCode.ppt ooad software software
kavitamittal18
 
Introduction.ppt wireless
Introduction.ppt                    wirelessIntroduction.ppt                    wireless
Introduction.ppt wireless
kavitamittal18
 
CellularNetworks.ppt ppt
CellularNetworks.ppt                                     pptCellularNetworks.ppt                                     ppt
CellularNetworks.ppt ppt
kavitamittal18
 
Dr.C S Prasanth-Physics ppt.pptx computer
Dr.C S Prasanth-Physics ppt.pptx computerDr.C S Prasanth-Physics ppt.pptx computer
Dr.C S Prasanth-Physics ppt.pptx computer
kavitamittal18
 
CSL101_Ch1.ppt Computer Science
CSL101_Ch1.ppt          Computer ScienceCSL101_Ch1.ppt          Computer Science
CSL101_Ch1.ppt Computer Science
kavitamittal18
 
maincse-150510153437-lva1-app68Computer Science92.ppt
maincse-150510153437-lva1-app68Computer Science92.pptmaincse-150510153437-lva1-app68Computer Science92.ppt
maincse-150510153437-lva1-app68Computer Science92.ppt
kavitamittal18
 
Programming language basics.ppt Computer Science
Programming language basics.ppt Computer ScienceProgramming language basics.ppt Computer Science
Programming language basics.ppt Computer Science
kavitamittal18
 
02-chapter-1.ppt programming languages 10
02-chapter-1.ppt programming languages 1002-chapter-1.ppt programming languages 10
02-chapter-1.ppt programming languages 10
kavitamittal18
 
CS553_ST7_Ch14-CellularWirelessNetworks.ppt
CS553_ST7_Ch14-CellularWirelessNetworks.pptCS553_ST7_Ch14-CellularWirelessNetworks.ppt
CS553_ST7_Ch14-CellularWirelessNetworks.ppt
kavitamittal18
 
Lec7!JavaThreads.ppt java multithreading
Lec7!JavaThreads.ppt java multithreadingLec7!JavaThreads.ppt java multithreading
Lec7!JavaThreads.ppt java multithreading
kavitamittal18
 
JDBC.ppt database connectivity in java ppt
JDBC.ppt database connectivity in java pptJDBC.ppt database connectivity in java ppt
JDBC.ppt database connectivity in java ppt
kavitamittal18
 
chapter7.ppt java programming lecture notes
chapter7.ppt java programming lecture noteschapter7.ppt java programming lecture notes
chapter7.ppt java programming lecture notes
kavitamittal18
 
09slide.ppt oops classes and objects concept
09slide.ppt oops classes and objects concept09slide.ppt oops classes and objects concept
09slide.ppt oops classes and objects concept
kavitamittal18
 
480 GPS Tech mobile computing presentation
480 GPS Tech mobile computing presentation480 GPS Tech mobile computing presentation
480 GPS Tech mobile computing presentation
kavitamittal18
 
gsm-archtecture.ppt mobile computing ppt
gsm-archtecture.ppt mobile computing pptgsm-archtecture.ppt mobile computing ppt
gsm-archtecture.ppt mobile computing ppt
kavitamittal18
 
ELECTORAL POLITICS KAMAL PPT.pptx
ELECTORAL POLITICS KAMAL PPT.pptxELECTORAL POLITICS KAMAL PPT.pptx
ELECTORAL POLITICS KAMAL PPT.pptx
kavitamittal18
 
Ad

Recently uploaded (20)

Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Data Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptxData Structures_Introduction to algorithms.pptx
Data Structures_Introduction to algorithms.pptx
RushaliDeshmukh2
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
DSP and MV the Color image processing.ppt
DSP and MV the  Color image processing.pptDSP and MV the  Color image processing.ppt
DSP and MV the Color image processing.ppt
HafizAhamed8
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
Introduction to FLUID MECHANICS & KINEMATICS
Introduction to FLUID MECHANICS &  KINEMATICSIntroduction to FLUID MECHANICS &  KINEMATICS
Introduction to FLUID MECHANICS & KINEMATICS
narayanaswamygdas
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Ad

UseCase.ppt software engineering use3 cases

  • 1. 1 NJIT Use Cases Supplemental Lecture for Chapter 2 of Xiaoping Jia OOSD using Java
  • 2. 2 Define the Problem  The most critical question:  “Is this the right system to make?”
  • 3. 3 Use Case Relationships Domain Model Use Case Model Interaction Diagrams Design Requirements Business Model Objects, attributes, associations VISION GLOSSARY SUPPLEMENTARY SPECIFICATION
  • 4. 4 Use Cases are not Diagrams  Use Cases may have a diagram associated with them, and a use case diagram is an easy way for an analyst to discuss a process with a subject matter expert (SME).  But use cases are primarily text. The text is important. The diagram is optional.
  • 5. 5 Emphasize Goals  Investigating goals rather than tasks and procedures improves information gathering by focusing on the essence of requirements —the intent behind them.  Seeing requirements as identifying tasks to be done has a strong bias toward reproducing the existing system, even when it is being replaced because it is seriously defective.
  • 6. 6 Why Use Cases?  Simple and familiar storytelling makes it easier, especially for customers, to contribute and review goals.  Use cases keep it simple (KISS)  They emphasize goals and the user perspective.  New use case writers tend to take them too seriously.
  • 7. 7 Actors or Use Case First?  Because you have to understand each part of Use Cases, the parts are presented separately. But those who create use cases switch back and forth. The text describes use cases substantially before paying attention to actors. Typically, both actors and use cases are identified early and then examined to see if more use cases can be found from the actors, or more actors found by examining the use cases.
  • 8. 8 Identify Use Cases  Capture the specific ways of using the system as dialogues between an actor and the system.  Use cases are used to  Capture system requirements  Communicate with end users and Subject Matter Experts  Test the system
  • 9. 9 Specifying Use Cases  Create a written document for each Use Case  Clearly define intent of the Use Case  Define Main Success Scenario (Happy Path)  Define any alternate action paths  Use format of Stimulus: Response  Each specification must be testable  Write from actor’s perspective, in actor’s vocabulary
  • 10. 10 www.usecases.org Template  Name  Primary Actor  Scope  Level  Stakeholders and Interests  Minimal Guarantee  Success Guarantee  Main Success Scenario  Extensions  This is the basic format used in the text and in Alistair Cockburn’s Writing Effective Use Cases (Addison Wesley, 2000, ISBN 0201702258).  I prefer to modify it slightly to use the actor actions and system response in tabular form. Larman calls this the Two-Column Variation.
  • 11. 11 Optional Items  You can add some of the following items  Trigger (after Success Guarantee)  (at end:)  Special requirements  Technology and Data Variations  Frequency of Occurrence  Open Issues
  • 13. 13 Elements in the Preface  Only put items that are important to understand before reading the Main Success Scenario. These might include:  Name (Always needed for identification)  Primary Actor  Stakeholders and Interests List  Preconditions  Success Conditions (Post Conditions)
  • 14. 14 Naming Use Cases  Must be a complete process from the viewpoint of the end user.  Usually in verb-object form, like Buy Pizza  Use enough detail to make it specific  Use active voice, not passive  From viewpoint of the actor, not the system
  • 15. 15 Hint  Appropriate use case names are very important. Because they are selected early, they tend to set the direction for the entire project.  Most common errors in use case diagrams are poor names, showing procedures instead of complete user processes, and not including the boundary and system name.  Rational Rose does not show the boundary and name, so assignments turned in using that tool do not have to have them. Rational Rose is preferred for assignments.
  • 16. 16 Golden Rule of Use-Case Names  Each use case should have a name that indicates what value (or goal) is achieved by the actor's interaction with the system  Here are some good questions to help you adhere to this rule:  Why would the actor initiate this interaction with the system? What goal does the actor have in mind when undertaking these actions? What value is achieved and for which actor? From Dr. Use Case (Leslee Probasco) in the Rational Edge, March, 2001
  • 17. 17 Use Case Name Examples  Excellent - Purchase Concert Ticket  Very Good - Purchase Concert Tickets  Good - Purchase Ticket (insufficient detail)  Fair - Ticket Purchase (passive)  Poor - Ticket Order (system view, not user)  Unacceptable - Pay for Ticket (procedure, not process)
  • 18. 18 CRUD  Examples of bad use case names with the acronym CRUD. (All are procedural and reveal nothing about the actor’s intentions.)  C - actor Creates data  R - actor Retrieves data  U - actor Updates data  D - actor Deletes data
  • 19. 19 Singular or Plural  This is usually determined by context.  There is a preference for the simplest form, but most common form can be better.  In the example of concert tickets, most people buy more than one, but a significant number buy only one.  At a supermarket, Buy Items would be best.  At a vending machine, it would be Buy Item.
  • 20. 20 Identify Actors  We cannot understand a system until we know who will use it  Direct users  Users responsible to operate and maintain it  External systems used by the system  External systems that interact with the system
  • 21. 21 Specifying Actors  Actors are external to the system  Actors are non-deterministic  What interacts with the system?  Actors may be different roles that one individual user interacts with the system  Actors may be other systems  Don’t assume that Actor = Individual
  • 22. 22 Types of Actors  Primary Actor  Has goals to be fulfilled by system  Supporting Actor  Provides service to the system  Offstage Actor  Interested in the behavior, but no contribution  In diagrams, Primary actors go on the left and others on the right.
  • 23. 23 Define Actors  Actors should not be analyzed or described in detail unless the application domain demands it.  Template for definition:  Name  Definition  Example for an ATM application: Customer: Owner of an account who manages account by depositing and withdrawing funds
  • 24. 24 Identifying Actors  Primary Actor  Emphasis is on the primary actor for the use case.  Stakeholders and Interests  Other actors are listed as stakeholders.  The interests of each key actor should be described.
  • 25. 25 Working with Use Cases  Determine the actors that will interact with the system  Examine the actors and document their needs  For each separate need, create a use case  During Analysis, extend use cases with interaction diagrams
  • 26. 26 Preconditions  Anything that must always be true before beginning a scenario is a precondition.  Preconditions are assumed to be true, not tested within the Use Case itself.  Ignore obvious preconditions such as the power being turned on. Only document items necessary to understand the Use Case.
  • 27. 27 Success Guarantees  Success Guarantees (or Postconditions) state what must be true if the Use Case is completed successfully. This may include the main success scenario and some alternative paths. For example, if the happy path is a cash sale, a credit sale might also be regarded a success.  Stakeholders should agree on the guarantee.
  • 28. 28 Scenarios  The Main Success Scenario, or “happy path” is the expected primary use of the system, without problems or exceptions.  Alternative Scenarios or Extensions are used to document other common paths through the system and error handling or exceptions.
  • 29. 29 Documenting the Happy Path  The Success Scenario (or basic course) gives the best understanding of the use case  Each step contains the activities and inputs of the actor and the system response  If there are three or more items, create a list  Label steps for configuration management and requirements traceability  Use present tense and active voice  Remember that User Interface designers will use this specification Note: Do not use the term “happy path” in formal documents.
  • 30. 30 Extensions (Alternative Flows)  Extensions or Alternative Flow Use Cases allow the specification of  Different ways of handling transactions  Error processes  Sections are convenient way to handle alternative courses of action  Sections are a segment of a use case executed out of sequence
  • 31. 31 Two Parts for Extensions  Condition  Describe the reason for the alternative flow as a condition that the user can detect  Handling  Describe the flow of processing in the same manner as the happy path, using a numbering system consistent with the original section.
  • 32. 32 Documenting Extensions  Use same format as Happy Path  Document actions that vary from ideal path  Include error conditions  Number each alternate, and start with the condition: 3A. Condition: If [actor] performs [action] the system …  If subsequent steps are the same as the happy path, identify and label as (same)  Steps not included in alternate course are assumed not to be performed.
  • 33. 33 Special Requirements  If a non-functional requirement , quality attribute, or constraint affects a use case directly, describe it as a special requirement.
  • 34. 34 Types of Use Cases  The most common Use Cases are High Level Use Cases and Expanded Essential Use Cases in analysis, and Expanded Real Use Cases in design. The next slide gives definitions.  In addition, Use Case diagrams may be used in discussions with stakeholders while capturing their requirements.
  • 35. 35 Elaborating Use Cases  High Level Use Case (Brief)  Name, Actors, Purpose, Overview  Expanded Use Case (Fully Dressed)  Add System Events and System Responses  Essential Use Case (Black Box)  Leave out technological implications  Real Use Case (White Box)  Leave in technology
  • 36. 36 Expanded Essential Use Cases (Fully Dressed Use Cases)  Purpose:  to allow the system designer and client to visualize the flow of actor actions and system responses. From this the client will understand how users will use the system, and the designer will be able to write pseudocode for each function. In addition, it is possible to use this document to anticipate opportunities for user error, which must be accounted for in the final system.  Definitions:  What it is: an analysis document which describes in detail the elements of functions identified in a High Level Use Case.  What is is not: Expanded Essential Use Cases are not graphical drawings. They do not include stick figures, boxes representing the system, or any other icons found in a High Level Use Case although they may be associated with one.
  • 37. 37 Expanded Essential Use Cases  How to make one:  Step 1: Name the Use Case (system function, e.g. “enter timesheet information”).  Step 2: Identify the Actor(s) involved.  Step 3: Describe the Intent of the Use Case in language the client will understand.  Step 4: Identify the Assumptions and Limitations relevant to this Use Case and other Use Cases which the current one might extend or build upon.  Step 5: Specify the ideal flow of actions using two columns labeled “Actor Actions” and “System Responses.” Number each step. This constitutes the Happy Path for this Use Case.  Step 6: Identify opportunities for user error and create an Alternative Path to handle each.
  • 38. 38 Postconditions  Postconditions (or success guarantees) state what always must be true for a use case to succeed. Avoid the obvious, but clearly document any that are not obvious. This is one of the most important parts of a use case.
  • 39. 39 Conditions and Branching  Stick to the “Happy Path,” “Sunny Day Scenario,” Typical Flow, or Basic Flow (all names for the same basic idea) in the main section and defer all conditional sections and branching to the extensions or alternate flows.
  • 40. 40 Warning  Use cases should not be misused to imitate function specification by successive iteration  Don’t refine them until the program is fully specified  The uses relation should only be used when the same scenario is encountered more than once
  • 41. 41 Use Cases not an OO idea  Use Cases are not an Object-Oriented methodology. They are common in structured development as well.  However, the Unified Process encourages use-case driven development.
  • 42. 42 Use case levels  User-goal level  A complete process from the view point of a user to meet a goal of the user, roughly corresponding to an elementary business process.  Subfunction level  Details steps to support a user goal.
  • 43. 43 Use-case driven development  Requirements are primarily recorded in the Use Case model.  Iterations are planned around implementing particular Use Cases.  Use Case Realizations drive design.  Use Case often influence the way user manuals are organized.
  • 44. 44 Use Cases are always wrong!  Written documentation gives the illusion of authority and correctness, but it is an illusion.  Use cases give a preliminary understanding that users and developers can discuss and agree on.  But there should be constant feedback from customers in the development process to correct missing information and misinformation before it jeopardizes the functionality of the program.

Editor's Notes

  • #36: The Expanded Essential Use Case is a transition document between the Analysis phase and the Design phase of software development. During this transition, documents are created less and less in langage of the client, and more and more in the language of the computer programmer. For Expanded Essential Use Cases there are two main goals: 1) to give the client an idea of what it will be like for the user to actually use the system and 2) to give the developer a start on developing system objects and pseudocode. With the Expanded Essential Use Case, the developer will be able to identify major events during system use and translate them into event contracts and function specifications. Each specification must describe something tangible and testable so that once the system has been completed it can be demonstrated that the Use Case was satisfied.
  • #37: The Expanded Essential Use Case is a transition document between the Analysis phase and the Design phase of software development. During this transition, documents are created less and less in langage of the client, and more and more in the language of the computer programmer. For Expanded Essential Use Cases there are two main goals: 1) to give the client an idea of what it will be like for the user to actually use the system and 2) to give the developer a start on developing system objects and pseudocode. With the Expanded Essential Use Case, the developer will be able to identify major events during system use and translate them into event contracts and function specifications. Each specification must describe something tangible and testable so that once the system has been completed it can be demonstrated that the Use Case was satisfied.