Oose Pd-Unit 2 Notes
Oose Pd-Unit 2 Notes
Kovilvenni-614 403
(NAAC Accredited with B Grade)
Department of Computer Science and Engineering
All plan-driven life cycle models prescribe that before starting to develop software;
the exact requirements of the customer must be understood and documented.
Starting development work without properly understanding and documenting the
requirements increases the number of iterative changes in the later life cycle
phases, and thereby alarmingly pushes up the development costs.
A good requirements document not only helps to form a clear understanding of
various features required from the software, but also serves as the basis for
various activities carried out during later life cycle phases.
Requirements gathering.
● Requirements gathering is also popularly known as requirements elicitation.
● The primary objective of the requirements gathering task is to collect the
requirements from the stakeholders.
● A stakeholder is a source of the requirements and is usually a person, or a group of
persons who either directly or indirectly are concerned with the software.
● It is very difficult to gather all the necessary information form a large number of
stakeholders and from information scattered across several pieces of documents.
● Gathering requirements turns out to be especially challenging if there is no
workingmodel of the software being developed.
● Important ways in which an experienced analyst gathers requirements:
Studying existing documentation:
The analyst usually studies all the available documents regarding the system to be
developed before visiting the customer site.
Customers usually provide a statement of purpose (SoP) document to the
developers.
Interview:
Typically, there are many different categories of users of software.
Each category of users typically requires a different set of features from the
software.
Therefore, it is important for the analyst to first identify the different categories of
users and then determine the requirements of each.
Task analysis:
The users usually have a black-box view of software and consider the software as
something that provides a set of services (functionalities).
A service supported by software is also called a task.
The analyst tries to identify and understand the different tasks to be performed
by the software.
For each identified task, the analyst tries to formulate the different steps
necessary to realize the required functionality in consultation with the users.
Scenario analysis:
A task can have many scenarios of operation.
The different scenarios of a task may take place when the task is invoked under
different situations.
For different types of scenarios of a task, the behavior of the software can be
different.
Form analysis:
Form analysis is an important and effective requirements gathering activity that is
undertaken by the analyst, when the project involves automating an existing
manual system.
In form analysis the existing forms and the formats of the notifications produced
are analyzed to determine the data input to the system and the data that are output
from the system.
Requirements analysis:
● After requirements gathering is complete, the analyst analyses the gathered
requirements to form a clear understanding of the exact customer requirements
and to weed out any problems in the gathered requirements.
● During requirements analysis, the analyst needs to identify and resolve three main
types of problems in the requirements:
Anomaly:
■ An anomaly is an ambiguity in a requirement. When a requirement is
anomalous, several interpretations of that requirement are possible.
■ Example: While gathering the requirements for a process control application,
the following requirement was expressed by a certain stakeholder: “When the
temperature becomes high, the heater should be switched off”. Please note
that words such as “high”, “low”, “good”, “bad” etc. are indications of
ambiguous requirements as these lack quantification and can be subjectively
interpreted.
Inconsistency:
■ Two requirements are said to be inconsistent, if one of the requirements
contradicts the other.
■ Example: Consider the following two requirements that were collected from
two different stakeholders in a process control application development
project.
● The furnace should be switched-off when the temperature of the furnace
rises above 500℃.
● When the temperature of the furnace rises above 500℃, the water
shower should be switched-on and the furnace should remain on.
Incompleteness:
■ An incomplete set of requirements is one in which some requirements have
been overlooked. The lack of these features would be felt by the customer
much later, possibly while using the software.
■ Example: In chemical plant automation software, suppose one of the
requirements is that if the internal temperature of the reactor exceeds 200℃
then an alarm bell must be sounded. However, on an examination of all
requirements, it was found that there is no provision for resetting the alarm
bell after the temperature has been brought down in any of the requirements.
This is clearly an incomplete requirement.
SOFTWARE REQUIREMENTS SPECIFICATION (SRS):
● After the analyst has gathered all the required information regarding the software to
be developed, and has removed all incompleteness, inconsistencies, and anomalies
from the specification, he starts to systematically organize the requirements in the
form of an SRS document.
● The SRS document usually contains all the user requirements in a structured though an
informal form. SRS document is probably the most important document
andisthetoughest to write.
● One reason for this difficulty is that the SRS document is expected to cater to the needs
of a wide variety of audience.
● A well-formulated SRS document finds a variety of usage:
Forms an agreement between the customers and the developers.
Reduces future reworks.
Provides a basis for estimating costs and schedules
Provides a baseline for validation and verification
Facilitates future extensions
Implementation-independent:
The SRS should be free of design and implementation decisions unless those
decisions reflect actual requirements.
It should only specify what the system should do and refrain from stating how to
do these.
Traceable:
It should be possible to trace a specific requirement to the design elements that
implement it and vice versa. Similarly, it should be possible to trace arequirement
to the code segments that implement it and the test cases that test this requirement
and vice versa.
Modifiable:
Customers frequently change the requirements during the software development
due to a variety of reasons. Therefore, in practice the SRS document undergoes
several revisions during software development.
To cope up with the requirements changes, the SRS document should be easily
modifiable. For this, an SRS document should be well-structured.
Identification of response to undesired events:
The SRS document should discuss the system responses to various undesired
events and exceptional conditions that may arise.
Verifiable:
All requirements of the system as documented in the SRS document should be
verifiable.
This means that it should be possible to design test cases based onthe description
of the functionality as to whether or not requirements have been met in an
implementation.
Functional Requirements:
The functional requirements capture the functionalities required by the users from the
system.
Consider software as offering a set of functions {fi} to the user.
These functions can be considered similar to a mathematical function f : I → O, meaning
that a function transforms an element (ii) in the input domain(I) to a value(oi) in the
output (O).
In order to document the functional requirements of a system, it is necessary to first
learn to identify the high-level functions of the systems by reading the informal
documentation of the gathered requirements.
Each high-level function is an instance fuse of the system (use case) by the user in
some way.
A high-level function is one using which the user can get some useful piece of work
done.
Each high-level requirement typically involves accepting some data from the user
through a user interface, transforming it to the required response, and then displaying
the system response in proper format.
A high-level function transforms certain input data to output data.
Except for very simple high- level functions, a function rarely reads all its required data
in one go and rarely outputs all the results in one shot.
A high-level function usually involves a series of interactions between the system and
one or more users.
Functional requirements form the basis for most design and test methodologies.
Unless the functional requirements are properly
Identified and documented, the design and testing activities cannot be carried out
satisfactorily.
Once all the high-level functional requirements have been identified and the
requirements problems have been eliminated, these are documented.
A function can be documented by identifying the state at which the data is to be input
to the system, its input data domain, the output data domain, and the type of
processing to be carried on the input data to obtain the output data.
Non-functional Requirements:
The non-functional requirements are non-negotiable obligations that must be
supportedby the software.
The non-functional requirements capture those requirements of the customer that
cannotbe expressed as functions.
Aspects concerning external interfaces, user interfaces, maintainability, portability,
usability, maximum number of concurrent users, timing, and throughput.
The non-functional requirements can be critical in the sense that any failure by the
developed software to achieve some minimum defined level in these requirements can
be considered as a failure and make the software unacceptable by the customer.
Design and implementation constraints:
Design and implementation constraints are an important category of non-functional
requirements describing any items or issues that will limit the optio ns available to the
developers.
Some of the example constraints can be—corporate or regulatory policies that
need to be honored; hardware limitations; interfaces with other applications;
specific technologies, tools, and databases to be used; specific communications
protocols to be used; security considerations etc.
External interfaces required:
Examples of external interfaces are-hardware, software and communication
interfaces, user interfaces, report formats, etc.
To specify the user interfaces, each interface between the software and the users
must be described.
One example of a user interface requirement of software can be that it should be
usable by factory shop floor workers who may not even have a high school degree.
The details of the user interface design such as screen designs, menu structure,
navigation diagram, etc.
It should be documented in a separate user interface specification document.
Other non-functional requirements:
This section contains a description of non- functional requirements that are
neither design constraints nor are external interface requirements.
An important example is a performance requirement such as the number of
transactions completed per unit time.
Goals of implementation:
The ‘goals of implementation’ part of the SRS document offers some general
suggestions regarding the software to be developed.
A goal, in contrast to the functional and nonfunctional requirements, is not checked
bythe customer for conformance at the time of acceptance testing.
The goals of the implementation section might document issues such as easier
revisions to the system functionalities that may be required in the future, easier
support for new devices to be supported in the future, reusability issues, etc.
Formal methods are usually classified into two broad categories—the so called
model-oriented and the property-oriented approaches.
In a model oriented style, one defines a system’s behaviour directly by constructing
a model of the system in terms of mathematical structures such as tuples, relations,
functions, sets, sequences, etc.
In the property-oriented style, the system’s behaviour is defined indirectly by
stating its properties, usually in the form of a set of axioms that the system must
satisfy.
Let us consider a simple producer/consumer example. In a property-oriented style,
we would probably start by listing the properties of the system like—the consumer
can start consuming only after the producer has produced an item, the producer
starts to produce an item only after the consumer has consumed the last item, etc.
Two examples of property-oriented specification styles are axiomatic specification
and algebraic specification.
In a model-oriented style, we would start by defining the basic operations, p
(produce) and c (consume). Then we can state that S1 + p ⇒ S, S + c ⇒ S1. Thus
model-oriented approaches essentially specify a program by writing another,
presumably simpler program. A few notable examples of popular model-oriented
specification techniques are Z, CSP,CCS, etc.
It is alleged that property-oriented approaches are more suitable for requirements
specification, and that the model-oriented approaches are more suited to system
design specification.
Operational Semantics
Informally, the operational semantics of a formal method is the way computations
are represented.
There are different types of operational semantics according to what is meant by a
single run of the system and how the runs are grouped together to describe the
behaviour of the system.
Linear semantics:
In this approach, a run o f a system is described by a sequence (possibly infinite) of
events or states.
The concurrent activities of the system are represented by non-deterministic
interleavings of the atomic actions. For example, a concurrent activity a || b is
represented by the set of sequential activities a; b and b; a. This is a simple but
rather unnatural representation of concurrency.
The behaviour of a system in this model consists of the set of all its runs. To make
this model more realistic, usually justice and fairness restrictions are imposed on
computations to exclude the unwanted interleavings.
Branching semantics:
In this approach, the behaviour of a system is represented by a directed graph.
The nodes of the graph represent the possible states in the evolution of a system.
The descendants of each node of the graph represent the states which can be
generated by any of the atomic actions enabled at that state.
Although this semantic model distinguishes thebranching points in a computation,
still it represents concurrency by interleaving.
Maximally parallel semantics:
In this approach, all the concurrent actions enabled at any state are assumed to be
taken together.
This is again not a natural model of concurrency since it implicitly assumes the
availability of all the required computational resources.
Partial order semantics:
Under this view, the semantics ascribed to a system is a structure of states
satisfying a partial order relation among the states (events).
The partial order represents a precedence ordering among events, and constrains
some events to occur only after some other events have occurred; while the
occurrence of other events (called concurrent events) is considered to be
incomparable.
This fact identifies concurrency as a phenomenon not translatable to any
interleaved representation.
Merits of formal methods
Formal specifications encourage rigour. It is often the case that the very process of
construction of a rigorous specification is more important than the formal
specification itself.
Modelling language:
A modelling language consists of a set of notations using which design and analysis
models are documented.
Design process:
A design process consists of a step by step procedure (or recipe) using which a
problem description can be converted into a design solution.
A design process is, at times, also referred to as a design methodology.
Example: The use case model for the Tic-tac-toe game software is shown in Figure
below:
This software has only one use case, namely, “play move”. Note that we did not name
the use case “get-user-move”, as “get user-move” would be inappropriate because this
would represent the developer’s perspective of the use case. The use cases should be
named from the users’ perspective.
Text description
Each ellipse in a use case diagram, by itself conveys very little information, other than
giving a hazy idea about the use case. Therefore, every use case diagram should be
accompanied by a text description.
The text description should define the details of the interaction between the user and
the computer as well as other relevant aspects of the use case.
Contact persons:
This section lists of personnel of the client organization with whom the use case was
discussed, date and time of the meeting, etc.
Actors:
In addition to identifying the actors, some information about actors using a use case
which may help the implementation of the use case may be recorded.
Pre-condition:
The preconditions would describe the state of the system before the use case
execution starts.
Post-condition:
This captures the state of the system after the use case has successfully completed.
Non-functional requirements:
This could contain the important constraints for the design and implementation, such
as platform and environment conditions, qualitative statements, response time
requirements, etc.
Exceptions, error situations:
This contains only the domain-related errors such as lack of user’s access rights,
invalid entry in the input fields, etc.
Obviously, errors that are not domain related, such as software errors, need not be
discussed here.
Sample dialogs:
These serve as examples illustrating the use case.
Specific user interface requirements:
These contain specific requirements for the user interface of the use case. For
example, it may contain forms to be used, screen shots, interaction style, etc.
Document references:
This part contains references to specific domain related documents which may be
useful to understand the system operation.
Generalisation
Generalisation works the same way with use cases as it does with classes.
The child use case inherits the behaviour and meaning of the present use case.
Figure: Representation of use case Generalisation
Includes
The includes relationship implies one use case includes the behaviour of another use
case in its sequence of events and actions.
The includes relationship is represented using a predefined stereotype <<include>>.
In the includes relationship, a base use case compulsorily and automatically includes
the behaviour of the common use case.
Composition
Composition is a stricter form of aggregation, in which the parts are existence-
dependent on the whole.
This means that the life of the parts cannot exist outside the whole. In other words, the
lifeline of the whole and the part are identical.
When the whole is created, the parts are created and when the whole is destroyed, the
parts are destroyed.
A typical example of composition is an order object where after placing the order, no
item in the order cannot be changed.
If any changes to any of the order items are required after the order has been placed,
then the entire order has to be cancelled and a new order has to be placed with the
changed items.
In this case, as soon as an order object is created, all the order items in it are created
and as soon as the order object is destroyed, all order items in it are also destroyed.
That is, the life of the components (order items) is the same as the aggregate (order).
The composition relationship is represented as a filled diamond drawn at the
composite-end. An example of the composition relationship is shown in below.
Dependency
A dependency relationship is shown as a dotted arrow that is drawn from the
dependent class to the independent class.
INTERACTION DIAGRAMS
When a user invokes one of the functions supported by a system, the required
behaviour is realised through the interaction of several objects in the system.
Interaction diagrams, as their name itself implies, are models that describe how
groups of objects interact among themselves through message passing to realise some
behaviour.
Typically, each interaction diagram realises the behaviour of a single use case.
There are two kinds of interaction diagrams—sequence diagrams and collaboration
diagrams.
These two diagrams are equivalent in the sense that any one diagram can be derived
automatically from the other. However, they are both useful.
These two actually portray different perspectives of behaviour of a system and
different types of inferences can be drawn from them.
The interaction diagrams play a major role in any effective object oriented design
process.
Sequence diagram
A sequence diagram shows interaction among objects as a two dimensional chart. The
chart is read from top to bottom.
The objects participating in the interaction are shown at the top of the chart as boxes
attached to a vertical dashed line.
Inside the box the name of the object is written with a colon separating it from the
name of the class and both the name of the object and the class are underlined.
This signifies that we are referring any arbitrary instance of the class.
For example, in below figure: Book represents any arbitrary instance of the Book
class.
An object appearing at the top of the sequence diagram signifies that the object existed
even before the time the use case execution was initiated.
However, if some object is created during the execution of the use case and
participates in the interaction (e.g., a method call), then the object should be shown at
the appropriate place on the diagram where it is created.
The vertical dashed line is called the object’s lifeline.
Any point on the lifeline implies that the object exists at that point.
Absence of lifeline after some point indicates that the object ceases to exist after that
point in time, particular point of time.
Normally, at the point if an object is destroyed, the lifeline of the object is crossed at
that point and the lifeline for the object is not drawn beyond that point.
A rectangle called the activation symbol is drawn on the lifeline of an object to indicate
the points of time at which the object is active. Thus an activation symbol indicates
that an object is active as long as the symbol (rectangle) exists on the lifeline.
Each message is indicated as an arrow between the lifelines of two objects.
The messages are shown in chronological order from the top to the bottom. That is,
reading the diagram from the top to the bottom would show the sequence in which the
messages occur.
Each message is labelled with the message name. Some control information can also
be included. Two important types of control information are:
A condition (e.g., [invalid]) indicates that a message is sent, only if the condition is
true.
An iteration marker shows that the message is sent many times to multiple receiver
objects as would happen when you are iterating over a collection or the elements of
an array. You can also indicate the basis of the iteration, e.g., [for every book object].
Figure: Sequence diagram for the renew book use case
Collaboration diagram
A collaboration diagram shows both structural and behavioural aspects explicitly.
This is unlike a sequence diagram which shows only the behavioural aspects.
The structural aspect of a collaboration diagram consists of objects and links among
them indicating association.
In this diagram, each object is also called a collaborator.
The behavioural aspect is described by the set of messages exchanged among the
different collaborators.
The link between objects is shown as a solid line and can be used to send messages
between two objects.
The message is shown as a labelled arrow placed near the link. Messages are prefixed
with sequence numbers because they are the only way to describe the relative
sequencing of the messages in this diagram.
Use of the collaboration diagrams in our development process would be to help us to
determine which classes are associated with which other classes.
Figure: collaboration diagram
ACTIVITY DIAGRAM
The activity diagram is possibly one modelling element which was not present in any
of the predecessors of UML.
The activity diagram focuses on representing various activities or chunks of
processing and their sequence of activation.
The activities in general may not correspond to the methods of classes. An activity is a
state with an internal action and one or more outgoing transitions which
automatically follow the termination of the internal activity.
If an activity has more than one outgoing transitions, then exact situation under which
each is executed must be identified through appropriate conditions.
Activity diagrams are similar to the procedural flow charts.
The main difference is that activity diagrams support description of parallel activities
and synchronisation aspects involved in different activities.
Parallel activities are represented on an activity diagram by using swim lanes. Swim
lanes enable you to group activities based on who is performing them, e.g., academic
department vs. hostel office.
Thus swim lanes sub divide activities based on the responsibilities of some
components.
The activities in swim lanes can be assigned to some model elements, e.g. classes or
some component, etc.
For example, In below Figure, the swim lane corresponding to the academic section,
the activities that are carried out by the academic section and the specific situation in
which these are carried out are shown below.
Figure: Activity diagram
STATE CHART DIAGRAM
A state chart diagram is normally used to model how the state of an object changes in
its life time.
State chart diagrams are good at describing how the behaviour of an object changes
across several use case executions.
However, if we are interested in modelling some behaviour that involves several
objects collaborating with each other, state chart diagram is not appropriate.
We have already seen that such behaviour is better modelled using sequence or
collaboration diagrams.
State chart diagrams are based on the finite state machine (FSM) formalism. An FSM
consists of a finite number of states corresponding to those of the object being
modelled.
The object undergoes state changes when specific events occur.
The FSM formalism existed long before the object-oriented technology and has been
used for a wide variety of applications.
Apart from modelling, it has even been used in theoretical computer science as a
generator for regular languages.
Why state chart?
A major disadvantage of the FSM formalism is the state explosion problem.
The number of states becomes too many and the model too complex when used to
model practical systems. This problem is overcome in UML by using state charts.
Basic elements of a state chart
The basic elements of the state chart diagram are as follows:
Initial state: This represented as a filled circle.
Final state: This is represented by a filled circle inside a larger circle.
State: These are represented by rectangles with rounded corners.
Transition: A transition is shown as an arrow between two states.
Data dictionary
Every DFD model of a system must be accompanied by a data dictionary. A data
dictionary lists all data items that appear in a DFD model.
The data items listed include all data flows and the contents of all data stores
appearing on all the DFDs in a DFD model.
However, a single data dictionary should capture all the data appearing in all the DFDs
constituting the DFD model of a system.
A data dictionary lists the purpose of all data items and the definition of all composite
data items in terms of their component data items.
For example, a data dictionary entry may represent that the data grossPay consists of
the components regularPay and overtimePay.
grossPay = regularPay + overtimePay
Data definition
Composite data items can be defined in terms of primitive data items using the
following data definition operators.
+: Denotes composition of two data items, e.g. a+b represents data a and b.
[,,]: Represents selection, i.e. any one of the data items listed inside the square bracket
can occur For example, [a,b] represents either a occurs or b occurs.
(): The contents inside the bracket represent optional data which may or may not
appear. a+(b) represents either a or a+b occurs.
{}: represents iterative data definition, e.g. {name}5 represents five name data.
{name}* Represents zero or more instances of name data.
=: Represents equivalence, e.g. a=b+c means that a is a composite data item
comprising of both b and c.
/* */: Anything appearing within /* and */ is considered as comment.
Levels of DFD
Level 0:
DFD Level 0 is also called a Context Diagram. It’s a basic overview of the whole system
or process being analyzed or modeled.
It’s designed to be an at-a-glance view, showing the system as a single high-level
process, with its relationship to external entities.
It should be easily understood by a wide audience, including stakeholders, business
analysts, data analysts and developers.
Level 1:
DFD Level 1 provides a more detailed breakout of pieces of the Context Level Diagram.
It highlights the main functions carried out by the system and break down the high-
level process of the Context Diagram into its sub processes
Level 2:
DFD Level 2 then goes one step deeper into parts of Level 1.
It may require more text to reach the necessary level of detail about the system’s
functioning.