Slide Set 6 Requirement Modeling
Slide Set 6 Requirement Modeling
Slide Set - 6
Organized & Presented By:
Software Engineering Team CSED
TIET, Patiala
Why Analysis Modeling ?
• Provides the first technical representation of a system
• Is easy to understand and maintain
• Deals with the problem of size by partitioning the system
• Uses graphics whenever possible
• Differentiates between essential information versus implementation
information
• Helps in the tracking and evaluation of interfaces
• Provides tools other than narrative text to describe software logic and
policy
2
Requirements Analysis
Purpose
4
Who Carries Out Requirements Analysis
and Specification?
• The person who undertakes requirements
analysis and specification:
– Known as systems analyst:
– Collects data pertaining to the product
– Analyzes collected data:
• To understand what exactly needs to be done.
– Writes the Software Requirements Specification (SRS)
document.
A Set of Models
• Flow-oriented modeling – provides an indication of how data objects
are transformed by a set of processing functions
• Scenario-based modeling – represents the system from the user's
point of view
• Class-based modeling – defines objects, attributes, and relationships
• Behavioral modeling – depicts the states of the classes and the
impact of events on these states
6
Elements of the Analysis Model
Object-oriented Analysis Structured Analysis
Scenario-based Flow-oriented
modeling modeling
Use case text Data structure diagrams
Use case diagrams Data flow diagrams
Activity diagrams Control-flow diagrams
Swim lane diagrams Processing narratives
Class-based Behavioral
modeling modeling
Class diagrams
State diagrams
Analysis packages
Sequence diagrams
CRC models
Collaboration diagrams
7
Analysis Modeling Approaches
• Structured analysis
– Considers data and the processes that transform the data as separate
entities
– Data is modeled in terms of only attributes and relationships (but no
operations)
– Processes are modeled to show the 1) input data, 2) the transformation
that occurs on that data, and 3) the resulting output data
• Object-oriented analysis
– Focuses on the definition of classes and the manner in which they
collaborate with one another to fulfill customer requirements
8
Flow-oriented Modeling
Data Modeling
• Identify the following items
– Data objects (Entities)
– Data attributes
– Relationships
– Cardinality (number of occurrences)
10
Data Flow and Control Flow
11
Diagram Layering and Process
Refinement
Context-level diagram
Level 1 diagram
12
Process Specification
Scenario-based Modeling
Writing Use Cases
• It is effective to use the first person “I” to describe how the actor
interacts with the software
• Format of the text part of a use case
Use-case title:
Actor:
Description: I …
Cook
Notify customer that
food and drink are ready
Customer
15
Activity Diagrams
16
Example Activity Diagram
Set counter = positive n
Set accumulator = initial value
F
n>1
T
Set accumulator = accumulator * n
Set n = n - 1
F (n mod 5) == 0
T
Display accumulator value
17
Return accumulator value
Class-based Modeling
Identifying Analysis Classes
1) Classes are determined by underlining each noun or noun clause
2) A class should NOT have an imperative procedural name (i.e., a verb)
19
(More on next slide)
Defining Attributes of a Class
• Attributes of a class are those nouns from the grammatical parse that
reasonably belong to a class
• Attributes hold the values that describe the current properties or state of a
class
20
Defining Operations of a Class
• Operations define the behavior of an object
21
Example Class Box
Class Name Component
+ componentID
- telephoneNumber
Attributes - componentStatus
- delayTime
- masterPassword
- numberOfTries
+ program()
+ display()
Operations + reset()
+ query()
- modify()
+ call()
22
Association, Generalization and
Dependency (Ref: Fowler)
• Association
– Represented by a solid line between two classes directed from the source
class to the target class
– Used for representing (i.e., pointing to) object types for attributes
– May also be a part-of relationship (i.e., aggregation), which is represented by
a diamond-arrow
• Generalization
– Portrays inheritance between a super class and a subclass
– Is represented by a line with a triangle at the target end
• Dependency
– A dependency exists between two elements if changes to the definition of one
element (i.e., the source or supplier) may cause changes to the other element
(i.e., the client)
– Examples
• One class calls a method of another class
• One class utilizes another class as a parameter of a method
23
Example Class Diagram
Accountant Auditor Record
Keeper
Report
Error Log Input Handler Account Account List
Generator
1..n
24
Behavioral Modeling
Creating a Behavioral Model
1) Identify events found within the use cases and implied by the
attributes in the class diagrams
2) Build a state diagram for each class, and if useful, for the whole
software system
26
Identifying Events in Use Cases
• An event occurs whenever an actor and the system exchange
information
27
Building a State Diagram
• A state is represented by a rounded rectangle
28
Example State Diagram
pop / set n to 0; return error push [n – 2 < max]
push [n = 0]
Empty Partially pop [n > 1]
Stack Filled Stack
pop [n = 1]
Full Stack
29
Summary:
Elements of the Analysis Model
Object-oriented Analysis Structured Analysis
Scenario-based Flow-oriented
modeling modeling
Use case text
Data flow diagrams
Use case diagrams
Control-flow diagrams
Activity diagrams
Processing narratives
Swim lane diagrams
Class-based Behavioral
modeling modeling
Class diagrams
State diagrams
Analysis packages
Sequence diagrams
CRC models
Collaboration diagrams
30