You are on page 1of 28

Object-Oriented Analysis & Design

Using UML, Patterns, and C#


# USE CASE #
Modeling with UML
Outline of this Class

• Requirements Engineering
• Functional Requirements
• Non Functional Requirements
• Use case diagrams
• Describe the functional behavior of the system as seen
by the user
• Use Case Relationships
• Extend
• Include

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 2
Developing Requirements
 System Requirements

OOAD

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 3
Requirements engineering
• The process of establishing the services that
the customer requires from a system and the
constraints under which it operates and is
developed
• 2 types of requirements classifications
• Functional requirements describe system functions
• Non-functional requirements are constraint on the
system
• A requirement may therefore be an abstract
statement of a system service or may be a
system constraint or even a mathematical
functional specification

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 4
A Typical Example
of Software Lifecycle Activities

Requirements System Detailed Implemen-


Analysis Testing
Elicitation Design Design tation

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 5
Requirements Engineering (RE) process
• RE is a spectrum of tasks and techniques that lead
to an understanding of requirements
• The processes used for RE vary widely depending
on the application domain, the people involved
and the organization developing the requirements.
• However, there are a number of generic activities
common to all processes
• Requirements elicitation;
• Requirements elaboration;
• Requirements validation;
• Requirements management.
• In practice, RE is an iterative activity in which
these processes are interleaved.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 6
RE activities expansion

• Requirement elicitation: Involves technical


staff working with customers to find out about
the application domain, the services that the
system should provide and the system’s
operational constraints.
• Requirement Elaboration: requirements from
the elicitation is expanded and refined. Focuses
on developing a refined requirement model, that
identifies various aspects of s/w functions,
behavior and information. Defines user
scenario’s that describe how users will interact
with the system

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 7
RE activities expansion (2)
• Requirement Validation: validates work
products produced from the elicitation and
elaboration stage. Examines the s/w
requirement specification to ensure that all s/w
requirements have been stated unambiguously;
that inconsistencies, omissions, and errors have
been detected and corrected
• Requirement Management: performs a set of
activities that help the project team identify,
control and track requirements and changes to
requirements at any time as project proceeds

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 8
Elicitation and Elaboration
• Software engineers work with a range of system
stakeholders to find out about the application
domain, the services that the system should
provide, the required system performance,
hardware constraints, other systems, etc.
• Stages include:
• Requirements discovery,
• Requirements classification and organization,
• Requirements prioritization and negotiation,
• Requirements specification.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 9
First step in identifying the Requirements:
System identification
• Two questions need to be answered:
1. How can we identify the purpose of a system?
2. What is inside, what is outside the system?
• These two questions are answered during
requirements elicitation and analysis
• Requirements elicitation:
• Definition of the system in terms understood by the
customer (“Requirements specification”)
• Analysis:
• Definition of the system in terms understood by the
developer (Technical specification, “Analysis model”)
• Requirements Process: Contains the activities
Requirements Elicitation and Analysis.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 10
Techniques to elicit Requirements

• Bridging the gap between end user and


developer:
• Questionnaires: Asking the end user a list of pre-
selected questions
• Task Analysis: Observing end users in their
operational environment
• Scenarios: Describe the use of the system as a series
of interactions between a concrete end user and the
system
• Use cases: Abstractions that describe a class of
scenarios.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 11
Types of Requirements

• Functional requirements
• Describe the interactions between the system and its
environment independent from the implementation
“An operator must be able to define a new game. “
• Nonfunctional requirements
• Aspects not directly related to functional behavior.
“The response time must be less than 1 second”
• Constraints
• Imposed by the client or the environment
• “The implementation language must be C# “

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 12
Functional vs. Nonfunctional Requirements

Functional Requirements Nonfunctional Requirements


• Describe user tasks • Describe properties of the
that the system needs system or the domain
to support • Phrased as constraints or
• Phrased as actions negative assertions
“Advertise a new league” “All user inputs should be
“Schedule tournament” acknowledged within 1
second”
“Notify an interest group”
“A system crash should not
result in data loss”.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 13
Types of Nonfunctional Requirements

• Usability • Implementation
• Reliability • Interface
• Robustness • Operation
• Safety • Packaging
• Performance • Legal
• Response time • Licensing (GPL, LGPL)
• Scalability • Certification
• Throughput • Regulation
• Availability
• Supportability
• Adaptability
• Maintainability Constraints or
Quality requirements Pseudo requirements
Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 14
Some Quality Requirements Definitions
• Usability
• The ease with which actors can use a system to perform a function
• Usability is one of the most frequently misused terms ((“The system
is easy to use”)
• Usability must be measurable, otherwise it is marketing
• Example: Specification of the number of steps – the measure! -
to perform a internet-based purchase with a web browser
• Robustness: The ability of a system to maintain a function
• even if the user enters a wrong input
• even if there are changes in the environment
• Example: The system can tolerate temperatures up to 90 C
• Availability: The ratio of the expected uptime of a system to
the aggregate of the expected up and down time
• Example: The system is down not more than 5 minutes per week.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 15
What should not be in the Requirements?

• System structure, implementation technology


• Development methodology
• Development environment
• Implementation language
• Reusability

• It is desirable that none of these above are


constrained by the client.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 16
Requirements Validation
Requirements validation is a quality assurance
step, usually performed after requirements
elicitation or after analysis
• Correctness:
• The requirements represent the client’s view
• Completeness:
• All possible scenarios, in which the system can be used,
are described
• Consistency:
• There are no requirements that contradict each other.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 17
Requirements Validation (2)
• Clarity:
• Requirements can only be interpreted in one way
• Realism:
• Requirements can be implemented and delivered
• Traceability:
• Each system behavior can be traced to a set of
functional requirements

• Problems with requirements validation:


• Requirements change quickly during requirements
elicitation
• Inconsistencies are easily added with each change
• Tool support is needed!

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 18
UML Basic Notation: First Summary

• UML provides a wide variety of notations for


modeling many aspects of software systems
• In the first lecture we concentrated on:
• Functional model: Use case diagram
• Object model: Class diagram
• Dynamic model: Sequence diagrams, state-chart

• Now we go into a little bit more detail…USE CASE

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 19
UML Use Case Diagrams
Used during requirements elicitation
and analysis to represent external
behavior (“visible from the outside of
the system”)
An Actor represents a role, that
is, a type of user of the system
Passenger
A use case represents a class of
functionality provided by the system

Use case model:


The set of all use cases that
PrintTicket completely describe the
functionality of the system.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 20
Actors
• An actor is a model for an external
entity which interacts
(communicates) with the system:
• User
• External system (Another system)
• Physical environment (e.g. Weather)

Passenger • An actor has a unique name and an


optional description Optional
Description
• Examples:
• Passenger: A person in the train
Name • GPS satellite: An external system that
provides the system with GPS
coordinates.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 21
Use Case
• A use case represents a class of
functionality provided by the
system
• Use cases can be described
textually, with a focus on the event
flow between actor and system
• The textual use case description
consists of 6 parts:
PurchaseTicket
1. Unique name
2. Participating actors
3. Entry conditions
4. Exit conditions
5. Flow of events
6. Special requirements.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 22
Textual Use Case
Description Example PurchaseTicket
Passenger

1. Name: Purchase ticket 5. Flow of events:


1. Passenger selects the
number of zones to be
2. Participating actor:
traveled
Passenger
2. Ticket Distributor displays
the amount due
3. Entry condition: 3. Passenger inserts money,
• Passenger stands in front of at least the amount due
ticket distributor 4. Ticket Distributor returns
change
• Passenger has sufficient
money to purchase ticket 5. Ticket Distributor issues
ticket
6. Special requirements:
4. Exit condition: None.
• Passenger has ticket

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 23
Uses Cases can be related

• Extends Relationship
• To represent seldom invoked use cases or exceptional
functionality
• Includes Relationship
• To represent functional behavior common to more than
one use case.

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 24
The <<extends>> Relationship
• <<extends>> relationships model
exceptional or seldom invoked
cases
• The exceptional event flows
Passenger are factored out of the main
event flow for clarity
• The direction of an <<extends>>
relationship is to the extended
PurchaseTicket use case
• Use cases representing
<<extends>> exceptional flows can extend
more than one use case.
<<extends>>
<<extends>>
OutOfOrder <<extends>> TimeOut

Cancel NoChange
Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 25
The <<includes>> Relationship
• <<includes>> relationship
represents common
functionality needed in more
than one use case
Passenger
• <<includes>> behavior is
factored out for reuse, not
PurchaseMultiCard because it is an exception
• The direction of a
PurchaseSingleTicket
<<includes>> relationship is to
<<includes>>
the using use case (unlike
<<includes>> the direction of the
<<extends>> relationship).

CollectMoney
<<extends>> <<extends>>
<<extends>>

NoChange Cancel Cancel


Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 26
Requirements Analysis Document Template
1. Introduction
2. Current system
3. Proposed system
3.1 Overview
3.2 Functional requirements
3.3 Nonfunctional requirements
3.4 Constraints (“Pseudo requirements”)
3.5 System models
3.5.1 Scenarios
3.5.2 Use case model
3.5.3 Object model
3.5.3.1 Data dictionary
3.5.3.2 Class diagrams
3.5.4 Dynamic models
3.5.5 User interfae
4. Glossary

Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 27
Section 3.3 Nonfunctional Requirements

3.3.1 User interface and human factors


3.3.2 Documentation
3.3.3 Hardware considerations
3.3.4 Performance characteristics
3.3.5 Error handling and extreme conditions
3.3.6 System interfacing
3.3.7 Quality issues
3.3.8 System modifications
3.3.9 Physical environment
3.3.10 Security issues
3.3.11 Resources and management issues
Keitumetse Gobotsamang Object-Oriented Analysis & Design Using UML, Patterns, and C# 28

You might also like