Unit 4.1 Requirements Modeling
Unit 4.1 Requirements Modeling
UNIT 2.1
REQUIREMENT ANALYSYS/MODELING
1
REQUIREMENT MODELING
What : combination of text and diagrams to depict requirements in a way that is easy to understand,
straightforward to review for correctness, completeness, and consistency.
Who : Software engineering builds the model using requirements elicited from users.
Why : Software examined from different perspective : scenario-based, data-based and class-based
model.
Work product : requirement models.
2
SA/SD METHODOLOGY
Structured Analysis/Structured Design (SA/SD) technique draws heavily from the design methodologies
proposed by the following authors:
DeMarco & Yourdon [1978], Constantine & Yourdon [1979], Gane & Sarson [1979], Hatley & Pirbhai [1987]
The SA/SD technique can be used to perform the high-level design of a software.
During structured analysis, the SRS document is transformed into a data flow diagram (DFD) model.
During structured design, the DFD model is transformed into a structure chart.
3
STRUCTURED ANALYSIS
Principles:
➢ Top-down decomposition approach.
➢ Application of divide and conquer principle.
➢ Graphical representation of the analysis results using data flow diagrams (DFDs).
4
DATA FLOW DIAGRAM (DFD)
DFD or bubble chart is graphical representation of flow of data or information through a process or system.
A DFD is a hierarchical graphical model of a system that shows the different processing activities or functions
that the system performs and the data interchange among those function
It approaches Function-oriented design methodology.
It clarifies system requirements and identifies major transformations.
It also gives insight into the inputs and outputs of each entity and the process itself.
DFD does not have control flow or execution sequence and no loops or decision rules are present.
It represents system at different level of abstraction.
It may be portioned into levels that represent increasing information flow and functional details.
It provides an overview of
• What data is system processes, What transformation are performed.
5
• What data are stored., What results are produced , etc.
DE MARCO NOTATIONS FOR DFD
Data flow b/w two processes or b/w external entity and process
or Database
External entity or
or Input/Output
6
LEVEL 0 DFD
10
LEVEL 1 DFD
11
12
LEVEL 2 DFD
It represents processes within each
functions of the system and how they
interact with each-other.
This level provides an even more
detailed view of the system
by breaking down the sub-processes
identified in the level 1 DFD into further
sub-processes.
Each sub-process is depicted as a
separate process on the level 2 DFD.
The data flows and data stores
associated with each sub-process are
also shown.
13
DATA FLOW DIAGRAM(DFS)
Key points:
Context diagram should depict the system as a single bubble.
All external entities interacting with the system should be represented only in the context diagram.
The external entities should not appear in the DFDs at any other level.
DFDs at the different levels of a DFD model must be balanced.
Only three to seven bubbles per diagram should be allowed.
Do not attempt to represent control information in a DFD.
A data flow arrow should not connect two data stores or even a data store with an external entity.
The data and function names must be intuitive.
Not to consider when or condition under which function is invoked or in what order different functions
(processes) are invoked.
Too many data flowing in or out of DFD, it is better to combine these data items into a high-level data item.
14
15
16
17
SUPERMARKET PRIZE SCHEME
A super market needs to develop a software that would help it to automate a scheme that it plans to
introduce to encourage regular customers.
In this scheme, a customer would have first register by supplying his/her details.
Each customer who registers for this scheme is assigned a unique customer number (CN) by the
computer.
A customer can present his CN to the check out staff when he makes any purchase.
Value of his purchase is credited against his CN.
At the end of each year, the supermarket intends to award surprise gifts to 10 customers who make
the highest total purchase over the year.
Also, it intends to award a 22 caret gold coin to every customer whose purchase exceeded Rs.
10,00,000.
The entries against the CN are reset on the last day of every year after the prize winners’ lists are
18
generated.
Context Diagram
Level-1Diagram 19
Level- 2 Diagram
DATA FLOW DIAGRAM (DFD)
The bubbles are decomposed into subfunctions at the successive levels of the DFD model.
Construction of context diagram:
➢ Examine the SRS document to determine:
➢ Different high-level functions that the system needs to perform.
➢ Data input, Data output, Interactions (data flow) to every high-level function.
Construction of level 1 diagram:
➢ Examine the high-level functions described in the SRS document.
➢ If there are three to seven high-level requirements in the SRS document, then represent each with a bubble.
➢ If more than seven bubbles, combine and If less than three bubbles, split.
Construction of lower-level diagrams:
➢ Decompose each high-level function into its constituent subfunctions through: 20
21
DFD
Dos Don’ts
22
FOOD ORDER SYSTEM - DFD
23
CONTROL FLOW DIAGRAM (CFD)
24
UML
Testing, etc.
UML DIAGRAM
User’s view : view of the system in terms of the functionalities offered by the system to its
users.
Structural view : structure of problem in terms of kinds of objects (classes) & its
relationship.
static model, since the structure of a system does not change with time.
Behavioral view : interaction of objects with each other to realize the system behavior.
captures the time-dependent (dynamic) behavior of the system.
Implementation view : important components of the system and their
interdependencies.
Environmental view : different components are implemented on different pieces of
28
hardware.
UML DIAGRAM CLASSIFICATION
There are two broad categories of diagrams, - Structural Diagrams and Behavioral Diagrams.
Structural diagrams ▪ Behavioral diagram
It represent the static aspect of system. It capture the dynamic aspect of system.
➢ Class diagram ➢ Use case diagram
➢ Object diagram ➢ Sequence diagram
➢ Component diagram ➢ Collaboration diagram
➢ Deployment diagram ➢ State chart diagram
➢ Activity diagram
Another classification of UML diagram is:
Static: Use case diagram, Class diagram and Object diagram
Dynamic: State diagram, Activity diagram, Sequence diagram, Collaboration diagram 29
The use case model for any system consists of a set of use cases.
The use cases represent functions performed by the actors interacting with the system.
A simple way to find all the use cases of a system is to ask the question —
“What can the different categories of users do by using the system?”
▪ It correspond to the high-level functional requirements.
▪ In contrast to all other types of UML diagrams, use case model represents functional or
process model of system.
31
REPRESENTATION OF USE CASE DIAGRAM
It is a behavioral diagram.
Each use case is represented by an ellipse with name of the use case written inside the ellipse.
All use cases of system are enclosed within a rectangle which represents the system boundary.
Name of system being modeled (e.g., library information system ) appears inside rectangle.
Anything within the box represents functionality that is in scope and anything outside the box is
not.
An actor is a role played by a user with respect to the system use.
Consists of one main line sequence (interactions between a user and the system that normally
take place) and several alternate sequences (Several variations to the main line sequence).
A sequence corresponding to the invocation of a use case is called a scenario of the use case.
32
USE CASE - TEXT DESCRIPTION
35
ASSOCIATION BETWEEN ACTOR AND USE CASE
37
INCLUDE BETWEEN TWO USE CASES
41
CLASS DIAGRAMS
It is a structural diagram.
It describes the static view/aspect/structure of a system.
Object oriented view of the system
It comprises a number of class diagrams and their dependencies.
The main constituents of a class diagram are classes and their relationships—
Visibility notations – (+→ public ; - → private ; # → protected)
generalisation, aggregation, association, and various kinds of
dependencies.
42
CLASS DIAGRAM
43
CLASS DIAGRAM
Attributes: Operations:
Attributes are listed with their names, and may parameters of a function may have a kind specified.
optionally contain specification of their type , an initial “in” - parameter is passed into the operation; or
value, and constraints. “out” - parameter is only returned from operation;
An attribute without square brackets must hold “inout” - parameter is used for passing data into the
exactly one value. operation and getting result from the operation.
square brackets contains a multiplicity expression, return type consisting of a single return type
expression.
initialisation expression.
issueBook(in bookName):Boolean
sensorStatus[1]:Int=0 class scope (i.e., shared among all the objects of the
class) and is denoted by underlining the operation
44
name.
CLASS DIAGRAM RELATIONSHIP
45
ASSOCIATION
It depicts static relationship b/w classes.
Represented by drawing a labelled straight line, with direction, between the concerned classes.
An arrowhead placed on the association line indicates the reading direction of the association.
On each side of association relation, multiplicity is noted as an individual number or as a value range.
Multiplicity indicates how many instances of one class are associated with the other.
Value ranges of multiplicity noted by specifying min and max value, separated by two dots, e.g. 1..5, 1..*
An asterisk is used as a wild card and means many (zero or more).
Read as “Many books may be borrowed by a LibraryMember”.
0..1→Zero or one, 1→One only, * or 0..*→Zero or more, 1..*→One or more, 7→Seven only, 4..7→Four to seven
46
DEPENDENCY
It is shown as a dotted arrow that is drawn from the dependent class to the independent class.
47
AGGREGATION
Special type of association relation where the involved classes are not only associated to each other,
but a whole-part relationship exists between them. (has-a relationship)
Represented by an empty diamond symbol at the aggregate end of a relationship.
There is no strong dependency from contained class to container class(books exist without library)
It cannot be reflexive (i.e. recursive), an object cannot contain objects of the same class as itself.
It is not symmetric.That is, two classes A and B cannot contain instances of each other.
It can be transitive. In this case, aggregation may consist of an arbitrary number of levels.
Numbering notation on the line indicates, one document can have many paragraphs.
48
49
GENERALIZATION / SPECIALIZATION
Generalization - extracting shared
characteristics from two or more classes, and
combining them into a generalized superclass.
Specialization means creating new subclasses
from an existing class.
If it turns out that certain attributes,
associations, or methods only apply to some of
the objects of the class, a subclass can be
created.
The most inclusive class in a
generalization/specialization is called the
superclass and is generally located at the top of
the diagram.
The more specific classes are called subclasses 50
51
CONSTRAINTS
52
CLASS DIAGRAM
53
CLASS DIAGRAM
54
OBJECT DIAGRAMS
56
STATE DIAGRAM
Also known as state machine or state chart diagram.
Gives system’s behavior, dynamic nature & models lifetime of reactive
system.
Gives state dependent behavior of an object.
Object reacts differently to the same event, depending on the state in which the
object currently is.
State – situation or movement in lifespan or lifecycle of an object or way an object
exists at a time.
State name – unambiguous (relevant to system/scenario.)
Identify or analyze all the different states through which an object will go through,
57
59
External Transition :
Termination : X
STATE DIAGRAM
Guard condition is Boolean expression evaluated when trigger event occurs,
If condition is true, it transits to new state else remains in the same state.
For an event called online purchase, different states can be login, select the items,
put it in wish list or cart, create order, payment, shipment, parcel received.
Step 1 : Define the states or conditions that an object might be in, any point of time.
Step 2 : Describe the states – name, and entry, do , and exit activity.
Step 3 : Define transitions, from one state to another.
Step 4 : Define events and activity set triggers transition.
Step 5 : Define constraints on transition.
60
66
ONLINE PURCHASE – ACTIVITY DIAGRAM
67
BOOK ISSUE/BORROW – ACTIVITY DIAGRAM
68
SWIMLANE DIAGRAM
▪ The activity diagram only represents the activities being performed, but Swimlane describes who does what
in a process or activity performed.
▪ It simply describes who is responsible for the activities being performed in the activity diagram and how they
are responsible.
▪ Activity diagram is divided according to the class responsible for working or performing out these activities.
▪ It simply shows the connection and strong communication between these lanes and
69
▪ It is used to highlight waste, redundancy, and inefficiency in a process of an activity or program.
70
SCHOLERSHIP –SWIMLANE DIAGRAM
71
72
SALES PROCESS SWIMLANEFLOWCHART
73
Activity Diagram
State Chart Diagram
Model reactive systems Model non-reactive systems
Sequence of activities involved in a
Internal state of an object or system
process or workflow
States, transitions, events Activities, actions, transitions
More complex Less complex
Embedded systems, control systems, Business processes, workflows,
real-time systems software processes
Has trigger (arrow’s label) Has no trigger
No decision symbol but guard
Has decision symbol
condition
74
INTERACTION DIAGRAM
76
COMMUNICATION DIAGRAM
77
USE CASE - ONLINE STUDENT ENROLLING
78
COMMUNICATION DIAGRAM - ONLINE STUDENT ENROLLING
79
SEQUENCE DIAGRAM
80
SEQUENCE DIAGRAM COMPONENTS
1. Dimension - Drawn in two dimensions: I. Horizontal (Object Dimension) II. Vertical (Time Dimension)
2. Actor - Anyone how use to perform a certain function in system (can be someone or something).
3. Lifeline - A lifeline represents an individual participant in the interaction. Overlapping of lifeline of
objects is not allowed.
Lifeline notation with an actor element symbol is used when particular sequence diagram is owned
by the use case .
4. Activations - A thin rectangle box on a lifeline represents the time needed for an object to complete a
task. Actor will communicate with the objects of the system through activation bar.
Activation bar is a period or duration for which your respective object is active or operational.
5. Control Object - manages the collaboration of objects which gives effect to the Use Case Process.
6. Boundary Object - most use cases imply at least one boundary object & manages dialogue between
81
actor & system.
SEQUENCE DIAGRAM COMPONENTS
8. Focus of Control - indicates times during activation when processing is taking place within that object.
9. Guards - certain condition that must be met for a message to be sent to the object.
10. Alternative - choice between two or more message sequences.
11. Optional - similar to Guards where the fragment executes only if the supplied condition is true.
12. Parallel - each fragment is run in parallel.
13. Loops - The fragment may execute multiple times which may be need to model in a diagram.
83
SEQUENCE DIAGRAM
84
ACTIVITY DIAGRAM
NOTATION
85
GUARD
86
ALTERNATIVE
87
OPTIONAL
88
PARALLEL
89
LOOPS
90
LOGIN – SEQUENCE DIAGRAM
91
ONLINE COURSE ENROLMENT
STEP 1 – FIND DOMAIN CLASSES
Student
Course Domain Classes
Enrolment
EnrolStudent Control object
EnrolStudentUI Boundary object
92
ONLINE COURSE ENROLMENT
STEP 2 – DRAW CONTROL OBJECT LIFELINE
93
ONLINE COURSE ENROLMENT
STEP 3 - DRAW BOUNDARY OBJECT LIFELINE
94
ONLINE COURSE ENROLMENT
STEP 4 - DRAW ACTOR LIFELINE
95
ONLINE COURSE ENROLMENT
STEP 5 – ADDING MESSAGES
96
ONLINE COURSE ENROLMENT
STEP 6 - DRAW OBJECTS LIFELINE (STUDENT OBJECT)
97
ONLINE COURSE ENROLMENT
STEP 6 - DRAW OBJECTS LIFELINE (COURSE OBJECT)
98
ONLINE COURSE ENROLMENT
STEP 6 - DRAW OBJECTS LIFELINE (ENROLMENT OBJECT)
99
ONLINE COURSE ENROLMENT
INTERACTION
100
ONLINE COURSE ENROLMENT
PLACE DIAGRAM IN FRAME
101
ONLINE COURSE ENROLMENT – SEQUENCE DIAGRAM
102
HOTEL RESERVATION - SEQUENCE DIAGRAM
103
IMPLEMENTATION DIAGRAM
104
COMPONENT DIAGRAM
110
COMPONENT DIAGRAM
111
112
COMPONENT DIAGRAM
• The data (account and inspection ID) flows into the component via the port on the right-hand side
and is converted into a format the internal components can use. The interfaces on the right are
known as required interfaces, which represents the services the component needed in order to carry
out its duty.
• The data then passes to and through several other components via various connections before it is
output at the ports on the left. Those interfaces on the left are known as provided interface, which
represents the services to deliver by the exhibiting component.
• It is important to note that the internal components are surrounded by a large 'box' which can be the
overall system itself (in which case there would not be a component symbol in the top right corner) or
a subsystem or component of the overall system (in this case the 'box' is a component itself).
113
GENERAL COMPONENT DIAGRAM
Following are the general components that can be included into any system’s component diagram:
Central system server
All below packages interacts with Central system server.
User interface package (Optional interaction with central system server).
Utility data processing package (Optional interaction with central system server).
Operational detail package (Always uses/ interacts will central system server. )
Connect 2-3 databases package/ database
114
115
116
TICKET SELLING SYSTEM COMPONENT DIAGRAM EXAMPLE
117
CLIENT SERVER ARCHITECTURE – COMPONENT DIAGRAM
118
DEPLOYMENT DIAGRAM
To design the deployment diagram, node, component, artifact, and interface notation are used.
Artifacts(files) will be deployed on the nodes (computational unit) for execution.
It tells how software and hardware work together.
It can be used to model embedded system, client-server system, and fully distributed system.
It can also can be used to plan system architecture and documenting the deployment of software
components.
120
DEPLOYMENT DIAGRAM NOTATIONS
121
DEPLOYMENT DIAGRAM COMPONENTS
1. Nodes – Nodes are used to represent the hardware and software within a single system. It is
represented by cube and is the physical element in the entire system.
2. Artifacts – These are the core elements of a system which are the result of a certain process. These
files varies from Library, Archive, Executable and Config files. And are represented by a rectangular
box.
3. Communication Association – It is a connector. It connects two different Nodes and shows a path of
communication between Nodes.
4. Device Node – This element is technically a node that contains the computational resources within a
system.
5. Deployment Specifications – This element shows the sequence of configuration.
122
GENERAL DEPLOYMENT DIAGRAM
Following are the general components that can be made specific to include into any system’s
component diagram:
Web server device (all services supported by your system will be components of web server)
Application server device (Business logic- services provides by system layer & Data access layer –
which services you want to use)
Database server device (can be single or multiple database and specifies main component)
Number of users (will access web server through private network)
123
CLIENT SERVER ARCHITECTURE – DEPLOYMENT DIAGRAM
124
EMBEDDED SYSTEM – DEPLOYMENT DIAGRAM
125
DISTRIBUTED SYSTEM – DEPLOYMENT DIAGRAM
126
DECISION TABLE
127