UNIT II SE Notes
UNIT II SE Notes
The intent of requirements engineering is to provide all parties with a written understanding
of the problem. This can be achieved though a number of work products: usage scenarios,
functions and features lists, requirements models, or a specification.
Product requirements: These requirements specify how software product performs. Product
requirements comprise the following.
1. Efficiency requirements: Describe the extent to which the software makes optimal
use of resources, the speed with which the system executes, and the memory it
consumes for its operation. For example, the system should be able to operate at least
three times faster than the existing system.
2. Reliability requirements: Describe the acceptable failure rate of the software. For
example, the software should be able to operate even if a hazard occurs.
3. Portability requirements: Describe the ease with which the software can be
transferred from one platform to another. For example, it should be easy to port the
software to a different operating system without the need to redesign the entire
software.
4. Usability requirements: Describe the ease with which users are able to operate the
software. For example, the software should be able to provide access to functionality
with fewer keystrokes and mouse clicks.
Organizational requirements: These requirements are derived from the policies and
procedures of an organization. Organizational requirements comprise the following.
1. Delivery requirements: Specify when the software and its documentation are to be
delivered to the user.
2. Implementation requirements: Describe requirements such as programming language
and design method.
3. Standards requirements: Describe the process standards to be used during software
development. For example, the software should be developed using standards specified
by the ISO and IEEE standards.
External requirements: These requirements include all the requirements that affect the
software or its development process externally. External requirements comprise the
following.
User requirements are statements, in a natural language plus diagrams, of what services the
system is expected to provide to system users and the constraints under which it must operate.
The user requirements may vary from broad statements of the system features required to
detailed, precise descriptions of the system functionality.
User requirements describe what services the system is expected to
provide and the constraints under which it must operate.
These requirements should describe functional and non-functional
requirements so that they are understandable by system users who don’t have
detailed technical knowledge
They should specify only the external behaviour and avoid the
system design characteristics
User requirements are defined using natural language, tables, and diagrams
Problems faced with natural language:
1. Lack of clarity: It is sometimes difficult to use language in a precise and
unambiguous way without making the document wordy and difficult to read.
2. Requirements confusion: Functional requirements, non-functional
requirements, system goals and design information may not be clearly
distinguished.
3. Requirements amalgamation: Several different requirements may be
expressed together as a single requirement.
This requirement includes both conceptual and detailed information.
The user requirement should simply focus on the key facilities to be provided.
A rationale can be associated with each user requirement which explains why the
requirement has been included and is particularly useful when requirements are
changed
Guidelines to be followed to minimize misunderstandings when writing
user requirements:
1. Use a standard format to define all the requirement.
2. Use language consistently.
3. Use text highlighting (bold, italic or color) to pick out key parts of the
requirement.
4. Avoid using computer jargon /technical terms
System requirements are more detailed descriptions of the software system’s functions,
services, and operational constraints. The system requirements document (sometimes called a
functional specification) should define exactly what is to be implemented. It may be part of
the contract between the system buyer and the software developers.
System requirements describe the external behaviour of the system and its operational
constraints.
This explains how the user requirements should be provided by the system
System requirement should be a complete and consistent specification of the whole
system
Natural language is often used to write system requirements specifications
Drawbacks of using natural language specifications for specifying system requirements:
1. Ambiguity
The readers and writers of the requirement must interpret the same words in
the same way. NL is naturally ambiguous so this is very difficult.
2. Over-flexibility
The same thing may be said in a number of different ways in the specification.
3. Lack of modularisation
NL structures are inadequate to structure system requirements.
Alternate Notations used for System requirements specification
1.Structured natural language
This approach depends on defining standard forms or templates to express the
requirements specification.
2.Design description languages
This approach uses a language like a programming language but with more abstract
feature to specify the requirements by defining an operational model of the system
3. Graphical notations
A graphical language, supplemented by text annotations is used to define the
functional requirements for the system. Eg: SADT(structured analysis and design
techniques), use case diagram, sequence diagrams etc
4. Mathematical specifications
These are notations based on mathematical concepts such as finite-state machines or
sets. These unambiguous specifications reduce the arguments between customer and
contractor about system functionality
5.Structured natural language specifications
Structured natural language is a way of writing system requirements in a standard
format.
Advantage of this approach is that it maintains most of the expressiveness and
understandability of natural language but ensures that some degree of uniformity is
imposed on the specification.
Structured language notations limit the terminology that can be used and use templates
to specify system requirements.
They may include control constructs derived from programming languages and
graphical highlighting to partition the specification.
When a standard form is used for specifying functional requirements, the following
information should be included:
1. Description of the function or entity being specified
2. Description of its inputs and where these come from
3. Description of its outputs and where these go to
4. Indication of what other entities are used (the requires part)
5. Description of the action to be taken
6. If a functional approach is used, a pre-condition setting out what must be true
before the function is called and a post-condition specifying what is true after
the function is called
7. Description of the side effects (if any) of the operation.
Advantages:
Variability in the specification is reduced and requirements are organized more
effectively.
To avoid ambiguity, add extra information to natural language requirements using
tables or graphical models of the system. These can show how computations proceed,
how the system state changes, how users interact with the system and how sequences
of actions are performed.
Different kinds of requirement are needed to communicate information about a system to
different types of reader.
Figure illustrates the distinction between user and system requirements.
This example from the mental health care patient information system (Mentcare)
shows how a user requirement may be expanded into several system requirements. You can
see from Figure that the user requirement is quite general. The system requirements provide
more specific information about the services and functions of the system that is to be
implemented.
You need to write requirements at different levels of detail because different types of
readers use them in different ways. Figure below shows the types of readers of the user and
system requirements.
The readers of the user requirements are not usually concerned with how the system
will be implemented and may be managers who are not interested in the detailed facilities of
the system. The readers of the system requirements need to know more precisely what the
system will do because they are concerned with how it will support the business processes or
because they are involved in the system implementation.
The different types of document readers shown in Figure above are examples of
system stakeholders. As well as users, many other people have some kind of interest in the
system. System stakeholders include anyone who is affected by the system in some way and
so anyone who has a legitimate interest in it. Stakeholders range from end-users of a system
through managers to external stakeholders such as regulators, who certify the acceptability of
the system. For example, system stakeholders for the Mentcare system include:
1. Patients whose information is recorded in the system and relatives of these patients.
2. Doctors who are responsible for assessing and treating patients.
3. Nurses who coordinate the consultations with doctors and administer some
treatments.
4. Medical receptionists who manage patients’ appointments.
5. IT staff who are responsible for installing and maintaining the system.
6. A medical ethics manager who must ensure that the system meets current ethical
guidelines for patient care.
7. Health care managers who obtain management information from the system.
8. Medical records staff who are responsible for ensuring that system information can be
maintained and preserved, and that record keeping procedures have been properly
implemented.
Requirements engineering is usually presented as the first stage of the software engineering
process. However, some understanding of the system requirements may have to be developed
before a decision is made to go ahead with the procurement or development of a system. This
early-stage RE establishes a high-level view of what the system might do and the benefits
that it might provide. These may then be considered in a feasibility study, which tries to
assess whether or not the system is technically and financially feasible. The results of that
study help management decide whether or not to go ahead with the procurement or
development of the system.
Structure of SRS
1. Introduction
1.1 Purpose
1.2 Intended audience
1.3 Scope
1.4 Definition
1.5 Reference
2. Overall description
2.1 user interface system
2.2 interface Software and Hardware requirements constraints
2.3 user characteristics
3. System features and requirements
3.1 Functional requirement
3.2 Use case/sequence diagram
3.3 External interface requirement
3.4 Database requirement
3.5 Nonfunctional requirement
4. delivery for approval
Involvement of all the right people and only the right people.
The stakeholders not knowing what they need.
The requirements are expressed in terms of stakeholders.
The requirements of the stakeholders may be conflicting.
The changes in requirements during the process of analysis.
Several factors influence the requirements of the system in organization and politics.
A document consisting of requirements that are collected from various sources like
the requirements from customers expressed in an ordinary language and created by
the software analyst is called a specification document for software requirements .
The analyst understands the customers’ requirements in ordinary language and
converts them into a technical language that the development team can easily
understand.
Several models are used during the process of specification of software requirements
like Entity-Relationship diagrams (ER diagrams), data flow diagrams (DFD), data
dictionaries, function decomposition diagrams (FDD), etc.
2. Elicitation: This is the second phase of the requirements analysis process. This phase
focuses on gathering the requirements from the stakeholders. One should be careful in this
phase, as the requirements are what establishes the key purpose of a project. Understanding
the kind of requirements needed from the customer is very crucial for a developer. In this
process, mistakes can happen in regard to, not implementing the right requirements or
forgetting a part. The right people must be involved in this phase. The following problems
can occur in the elicitation phase:
Problem of Scope: The requirements given are of unnecessary detail, ill-defined, or not
possible to implement.
Problem of Understanding: Not having a clear-cut understanding between the
developer and customer when putting out the requirements needed. Sometimes the
customer might not know what they want or the developer might misunderstand one
requirement for another.
Problem of Volatility: Requirements changing over time can cause difficulty in leading
a project. It can lead to loss and wastage of resources and time.
3. Elaboration: This is the third phase of the requirements analysis process. This phase is
the result of the inception and elicitation phase. In the elaboration process, it takes the
requirements that have been stated and gathered in the first two phases and refines them.
Expansion and looking into it further are done as well. The main task in this phase is to
indulge in modeling activities and develop a prototype that elaborates on the features and
constraints using the necessary tools and functions.
4. Negotiation: This is the fourth phase of the requirements analysis process. This phase
emphasizes discussion and exchanging conversation on what is needed and what is to be
eliminated. In the negotiation phase, negotiation is between the developer and the customer
and they dwell on how to go about the project with limited business resources. Customers
are asked to prioritize the requirements and make guesstimates on the conflicts that may
arise along with it. Risks of all the requirements are taken into consideration and negotiated
in a way where the customer and developer are both satisfied with reference to the further
implementation. The following are discussed in the negotiation phase:
Availability of Resources.
Delivery Time.
Scope of requirements.
Project Cost.
Estimations on development.
5. Specification: This is the fifth phase of the requirements analysis process. This phase
specifies the following:
Written document.
A set of models.
A collection of use cases.
A prototype.
In the specification phase, the requirements engineer gathers all the requirements and
develops a working model. This final working product will be the basis of any functions,
features or constraints to be observed. The models used in this phase include ER (Entity
Relationship) diagrams, DFD (Data Flow Diagram), FDD (Function Decomposition
Diagrams), and Data Dictionaries.
A software specification document is submitted to the customer in a language that he/she
will understand, to give a glimpse of the working model.
6. Validation: This is the sixth phase of the requirements analysis process. This phase
focuses on checking for errors and debugging. In the validation phase, the developer scans
the specification document and checks for the following:
All the requirements have been stated and met correctly
Errors have been debugged and corrected.
Work product is built according to the standards.
This requirements validation mechanism is known as the formal technical review. The
review team that works together and validates the requirements include software engineers,
customers, users, and other stakeholders. Everyone in this team takes part in checking the
specification by examining for any errors, missing information, or anything that has to be
added or checking for any unrealistic and problematic errors. Some of the validation
techniques are the following-
Requirements reviews/inspections.
Prototyping.
Test-case generation.
Automated consistency analysis.
7. Requirements Management: This is the last phase of the requirements analysis process.
Requirements management is a set of activities where the entire team takes part in
identifying, controlling, tracking, and establishing the requirements for the successful and
smooth implementation of the project.
In this phase, the team is responsible for managing any changes that may occur during the
project. New requirements emerge, and it is in this phase, responsibility should be taken to
manage and prioritize as to where its position is in the project and how this new change will
affect the overall system, and how to address and deal with the change. Based on this
phase, the working model will be analyzed carefully and ready to be delivered to the
customer.
Classical analysis
Types of DFD
DFDs are of two types: Physical DFD and Logical DFD. The following table lists the points
that differentiate a physical DFD from a logical DFD.
Context Diagram
A context diagram helps in understanding the entire system by one DFD which gives the
overview of a system. It starts with mentioning major processes with little details and then
goes onto giving more details of the processes with the top-down approach.
The context diagram of mess management is shown below.
2. Data Dictionary
A data dictionary is a structured repository of data elements in the system. It stores the
descriptions of all DFD data elements that is, details and definitions of data flows, data stores,
data stored in data stores, and the processes.
A data dictionary improves the communication between the analyst and the user. It plays an
important role in building a database. Most DBMSs have a data dictionary as a standard
feature. For example, refer the following table −
3. Decision Trees
Decision trees are a method for defining complex relationships by describing decisions and
avoiding the problems in communication. A decision tree is a diagram that shows alternative
actions and conditions within horizontal tree framework. Thus, it depicts which conditions to
consider first, second, and so on.
Decision trees depict the relationship of each condition and their permissible actions. A
square node indicates an action and a circle indicates a condition. It forces analysts to
consider the sequence of decisions and identifies the actual decision that must be made.
The major limitation of a decision tree is that it lacks information in its format to describe
what other combinations of conditions you can take for testing. It is a single representation of
the relationships between conditions and actions.
For example, refer the following decision tree −
4. Decision Tables
Decision tables are a method of describing the complex logical relationship in a precise
manner which is easily understandable.
It is useful in situations where the resulting actions depend on the occurrence of one or
several combinations of independent conditions.
It is a matrix containing row or columns for defining a problem and the actions.
Components of a Decision Table
Condition Stub − It is in the upper left quadrant which lists all the condition to be
checked.
Action Stub − It is in the lower left quadrant which outlines all the action to be
carried out to meet such condition.
Condition Entry − It is in upper right quadrant which provides answers to questions
asked in condition stub quadrant.
Action Entry − It is in lower right quadrant which indicates the appropriate action
resulting from the answers to the conditions in the condition entry quadrant.
The entries in decision table are given by Decision Rules which define the relationships
between combinations of conditions and courses of action. In rules section,
Y shows the existence of a condition.
N represents the condition, which is not satisfied.
A blank - against action states it is to be ignored.
X (or a check mark will do) against action states it is to be carried out.
For example, refer the following table −
5. Structured English
Structure English is derived from structured programming language which gives more
understandable and precise description of process. It is based on procedural logic that uses
construction and imperative sentences designed to perform operation for action.
It is best used when sequences and loops in a program must be considered and the
problem needs sequences of actions with decisions.
It does not have strict syntax rule. It expresses all logic in terms of sequential decision
structures and iterations.
For example, see the following sequence of actions –
6. Pseudocode
A pseudocode does not conform to any programming language and expresses logic in plain
English.
It may specify the physical programming logic without actual coding during and after
the physical design.
It is used in conjunction with structured programming.
It replaces the flowcharts of a program.
Guidelines for Selecting Appropriate Tools
Use the following guidelines for selecting the most appropriate tool that would suit your
requirements −
Use DFD at high or low level analysis for providing good system documentations.
Use data dictionary to simplify the structure for meeting the data requirement of the
system.
Use structured English if there are many loops and actions are complex.
Use decision tables when there are a large number of conditions to check and logic is
complex.
Use decision trees when sequencing of conditions is important and if there are few
conditions to be tested
Petri Nets
Petri nets are a graphical for representing a system in which there are multiple
independent activities in progress at the same time.
The ability to model multiple activities differentiates Petri nets from finite state
machines. In a finite state machine there is always a single “current” state that
determines which action can next occur. In Petri nets there may be several states any
one of which may evolve by changing the state of the Petri net. Alternatively, some,
of even all, of these states may evolve in parallel causing several independent changes
to the Petri net to occur at once.
Basic Structure
A Petri net consists of four elements: places, transitions, edges, and tokens.
Graphically, places are represented by circles, transitions by rectangles, edges by
directed arrows, and tokens by small solid (filled) circles.
There are a wide variety of extensions to Petri nets. These extensions add features
to model probabilistic behavior, allow weighted edges, or have tokens of various
colors among others. Only the most basic Petri net concepts will be covered here.
A basic Petri net is shown in Figure 2.
This Petri net has four places, labeled P0 through P4, and three transitions, labeled
T0 through T2. Notice that places P0 and P2 each have a single token represented
by the black dot inside each place.
Edges, represented as directed arcs, connect places to transitions and transitions to
places.
In a properly formed Petri net, places cannot be directly connected to other places
and transitions cannot be directly connected to other transitions.
Also notice that the Petri net may contain cycles. The Petri net in Figure 2
contains two cycles. One cycle contains P0, T0, P1, T1, P3, and T3. The other
cycle contains T1, P4, T2, and P2. Cycles are common in Petri nets which
represent activities that happen repeatedly. For example, a web server repeated
services incoming requests to deliver web page content to different clients.
The state of a Petri net is represented by the occurrence of the tokens at various
places. The state of the Petri net in Figure 2 has tokens at places P0 and P2. It will
be shown that in another state of this Petri net there are tokens at states P1 and P2.
Yet another state has tokens at states P3 and P4.
Not all placements of tokens at places represent a possible state of the system. For
example, the Petri net in Figure 2 will never have as a possible state one in which
the only tokens are at places P1 and P4.
Which states are possible and which are not are determined by the structure of the
Petri net and the rules that define how a Petri net changes its state.
A Petri net changes from one state to the next state when a transition “fires”. The
firing of a transition involves the transition’s input places and output places.
The input places for a transition are all those places that have an edge directed
from the place to the transition.
The output places of a transition are all those places that have an edge directed
from the transition to the place.
For example, in Figure 2 the input places for transition T1 are places P1 and P2.
The output place for transition T0 is place P1 while the output places for transition
T1 are places P3 and P4.
The firing rules for a transition are:
1. a transition is able to fire when there is at least one token on each of the
transition’s input places, and
2. when a transition fires it removes one token from each of its input places
and produces a single token on each of its output places.
In the state of the Petri net shown in Figure 3 transition T1 is able to fire because there
are input tokens on each of its two input places, P1 and P2. Notice that transition T1
was not able to fire in the previous state of the Petri net (as shown in Figure 2). The
firing of transition T0 in the earlier state create a new state (the one shown in Figure 3)
in which transition T1 is now able to fire. It is common to find that the firing of a
transition creates a new state in which previously disabled (i.e., unable to fire)
transitions now become enabled (i.e., able to fire). Notice that in Figure 3, transition T1
is the only transition that is enabled. The firing of transition T1 in the state shown in
Figure 3 produces the new state shown in Figure 4. In the state of the Petri net shown
in Figure 4 both transitions T2 and T3 are enabled (i.e., able to fire). As noted about,
these transitions may fire in either order because the Petri net does not determine which
one of the two transitions is the next one to fire. The next state of the Petri net is, thus,
not uniquely determined. The next state can be the one following the firing of transition
T3 or the one following the firing of transition T2. The reader should draw both of
these states and see that they are different.
The state shown in Figure 4 will eventually lead back to one of the previous states. The
possibilities are: • transition T2 fires and then transition T3 fires, leading to the state shown in
Figure 2, • transition T3 fires and then transition T2 fires, leading to the state shown in Figure
2, or • transition T3 fires, transition T0 fires, and then transition T2 fires, leading to the state
shown in Figure 3. This Petri net will continue to transition among these states repeatedly.
It is possible that a single place may contain multiple tokens at one time. This situation
occurs frequently in dealing with resource allocation problems where there are multiple units
of a given resource to allocate. In these problems, a place typically represents the number of
available units of the resource. The specific number of units available at a given time is
denoted by the number of tokens contained in the place. When there are no token in the place,
meaning that there are no available units, activities which need a unit of the resource to
execute must wait until a unit is returned or produced. In some systems there are a fixed
number of units which are acquired and returned by the activities. For example, several
processes may acquire and release a printer during their execution. In other cases, the number
of units is variable. For example, in distributed system a sender may generate many data
packets that are waiting to be read by the receiver. Finally, the number of available units,
though variable, may be limited to a maximum amount. For example, in a distributed system
the number of unread data packets may be limited to some number so that the amount of
buffer space at the receiver is limited. The classical producer‐consumer problem is a
resource allocation problem with a variable number of resources that are limited to a
maximum number. There is a producer that generates new units and makes them available to
a consumer. The consumer takes one unit of the resource at a time. The primary
synchronization constraints are: • overflow: the producer cannot produce a new unit unless
the number of units is below the maximum number allowed, and • underflow: the consumer
cannot take a unit unless there is at least one available. The Petri net shown in Figure 8 is a
model of a producer‐consumer system where the maximum number of units is limited to 3. In
this model, there are two places that are used to represent the number of units produced but
not yet consumed and the number of additional units that can be produced. These places are
named Full and Empty, respectively. The names full and empty reflect that the units are often
contained in a fixed sized buffer of size N, where N is the maximum number of units
allowed. The number of buffer entries that are full contain produced units that are available to
the consumer and the number of buffer entries that are empty contain spaces available to the
producer to store new units. An invariant in this model is that number(full) + number(empty)
= N. The buffer is modeled in Figure 8 by the two places in the middle named Empty and
Full. The three tokens in the Empty place represent the initial state of the system with three
empty buffer elements. The absence of tokens in the Full place represents the initial state of
the system where there are no buffer elements with information.
The producer in Figure 8 is modeled as a subsystem with two places. The Generate place
represents the condition of the producer when it is generating the next unit of information to
transmit to the consumer. The Ready state represents the condition where the producer is
ready to insert the newly generated information into the buffer where it is will be available to
the consumer. Notice that the transition Produce for the producer can only fire when the
producer is Ready and there is at least one token in the Empty place (denoting a currently
empty buffer element into which the new information can be placed). The consumer in Figure
8 is modeled as a subsystem with two places. The Ready place represents the condition where
the consumer is ready to receive the next unit of new information that was generated by the
producer. Notice that the transition Take for the producer can only fire when the producer is
Ready and there is at least one token in the Full place (denoting a buffer element containing
new information which can be retrieved). The Process place in the producer represents the
condition of the consumer when it is processing the new information most recently retrieved
from the buffer. It can be observed that the producer‐consumer system in Figure 8 satisfies
the two primary synchronization constraints noted above. The overflow constraint is satisfied
because the producer cannot fire its Produce transition unless there is at least one token in the
Empty place. Thus, it is not possible for the Produce transition to fire four (or more) times in
a row without the Take transition firing one or more times. The underflow constraint is
satisfied because the consumer cannot fire its Take transition unless there is at least one token
in the Full place. Thus, it is not possible for the Take transition to fire four (or more) times in
a row without the Produce transition firing one or more times.
Data Dictionaries
A data dictionary is a file or a set of files that includes a database's metadata. The data
dictionary hold records about other objects in the database, such as data ownership, data
relationships to other objects, and other data. The data dictionary is an essential component of
any relational database. Ironically, because of its importance, it is invisible to most database
users. Typically, only database administrators interact with the data dictionary.
The data dictionary, in general, includes information about the following:
o Name of the data item
o Aliases
o Description/purpose
o Related data items
o Range of values
o Data structure definition/Forms