An Overview of Requirements Analysis and Specification Phase
An Overview of Requirements Analysis and Specification Phase
com******
Task analysis helps the analyst to understand the nitty-gritty of various user tasks
and to represent each task as a hierarchy of subtasks.
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 behaviour of
the software can be different. For example, the possible scenarios for the
book issue task of a library automation software may be:
Book is issued successfully to the member and the book issue slip is
printed.
The book is reserved, and hence cannot be issued to the member.
The maximum number of books that can be issued to the member is
already reached, and no more books can be issued to the member.
For requirements gathering, a member of the team who was responsible for
requirements analysis and specification (analyst) was first briefed by the HoD about
the specific activities to be automated. The HoD mentioned that three main aspects
of the office work needs to be automated—stores-related activities, student grading
activities, and student leave management activities. It was necessary for the analyst
to meet the other categories of users. The HoD introduced the analyst (a student) to
the office staff. The analyst first discussed with the two clerks regarding their specific
responsibilities (tasks) that were required to be automated. For each task, they asked
the clerks to brief them about the steps through which these are carried out. The
analyst also enquired about the various scenarios that might arise for each task. The
analyst collected all types of forms that were being used by the student and the staff
of the department to register various types of information with the office (e.g.
student course registration, course grading) or requests for some specific service (e.g.
issue of items from store). He also collected samples of various types of documents
(outputs) the clerks were preparing. Some of these had specific printed forms that
the clerks filled up manually, and others were entered using a spreadsheet, and then
printed out on a laser printer. Fo r each output form, the analyst consulted the clerks
regarding how these different entries are generated from the input data.
The analyst met the store keeper and enquired about the material issue procedures,
store ledger entry procedures, and the procedures for raising indents on various
vendors. He also collected copies of all the relevant forms that were being used by
the store keeper. The analyst also interviewed the student and faculty representatives.
Since it was needed to automate the existing activities of an working office, the
analyst could without much difficulty obtain the exact formats of the input data,
output data, and the precise description of the existing office procedures.
incomplete requirements:
Example 4.5 Suppose for the case study 4.1, one of the clerks expressed the
following—If a student secures a grade point average (GPA) of less than 6, then
the parents of the student must be intimated about the regrettable
performance through a (postal) letter as well as through e-mail. However, on
an examination of all requirements, it was found that there is no provision by
which either the postal or e-mail address of the parents of the students can
be entered into the system. The feature that would allow entering the e-mail
ids and postal addresses of the parents of the students was missing, thereby
making the requirements incomplete.
Example 4.6 In a chemical plant automation software, suppose one of the
requirements is that if the internal temperature of the reactor exceeds 200
C 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.
Concise: The SRS document should be concise and at the same time
unambiguous, consistent, and complete. Verbose and irrelevant
descriptions reduce readability and also increase the possibilities of
errors in the document.
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. This means that the SRS
document should specify the externally visible behaviour of the system
a nd not discuss the implementation issues. This view with which a
requirements specification is written, has been shown in Figure 4.1.
Observe that in Figure 4.1, the SRS document describes the output
produced for the different types of input and a description of the
processing required to produce the output from the input (shown in
ellipses) and the internal working of the software is not discussed at
all.
The SRS document should describe the system to be developed as a black box, and
should specify only the externally visible behaviour of the system. For this reason, the
S R S document is also called the black-box specification of the software being
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
developed.
Functional requirements
The functional requirements capture the functionalities required by the
users from the system. We have already pointed out in Chapter 2 that it
is useful to consider a 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). This functional
view of a system is shown schematically in Figure 4.1. Each function fi
of the system can be considered as reading certain data ii, and then
transforming a set of input data (ii) to the corresponding set of output
data (oi). The functional requirements of the system, should clearly
describe each functionality that the system would support along with
the corresponding input and output data set. Considering that the
functional requirements are a crucial part of the SRS document, we
discuss functional requirements in more detail in Section 4.2.6. Section
4.2.7 discusses how the functional requirements can be identified from
a problem description.
Finally, Section 4.2.8 discusses how the functional requirements can be
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
documented effectively.
Non-functional requirements
The non-functional requirements are non-negotiable obligations that must be
supported by the software. The non-functional requirements capture those
requirements of the customer that cannot be expressed as functions (i.e.,
accepting input data and producing output data). Non-functional
requirements usually address aspects concerning external interfaces, user
interfaces, maintainability, portability, usability, maximum number of
concurrent users, timing, and throughput (transactions per second, etc.). 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.
The IEEE 830 standard recommends that out of the various non-functional
requirements, the external interfaces, and the design and implementation constraints
should be documented in two different sections. The remaining non-functional
requirements should be documented later in a section and these should include the
performance and security requirements.
the books borrowed by him are displayed. The user can renew any of his
borrowed books by indicating them. A requested book cannot be renewed if it
is reserved by another user. In this case, an error message would be
displayed.
R.2.1: Select renew option
State: The user has logged in and the main menu has been displayed.
Input: “Renew” option selection.
Output: Prompt message to the user to enter his membership number and
password.
R.2.2: Login
State: The renew option has been selected.
Input: Membership number and password.
Output: Li st of the books borrowed by the user is displayed, and user is
prompted to select the books to be renewed, if the password is valid. If the
password is invalid, the user is asked to re-enter the password.
Processing: Password validation, search the books issued to the user from the
borrower’s list and display.
Next function: R.2.3 if password is valid and R.2.2 if password is invalid.
R.2.3: Renew selected books
Input: User choice for books to be renewed out of the books borrowed by him.
Output: Confirmation of the books successfully renewed and apology message
for the books that could not be renewed.
Processing: Check if any one has reserved any of the requested books. Renew
the books selected by the user in the borrower’s list, if no one has reserved
those books.
In order to properly identify the high-level requirements, a lot of common
sense and the ability to visualise various scenarios that might arise in the
operation of a function are required. Please note that when any of the
aspects of a requirement, such as the state, processing description, next
function to be executed, etc. are obvious, we have omitted it. We have to
make a trade-off between cluttering the document with trivial details versus
missing out some important descriptions.
Specification of large software: If there are large number of functional
requirements (much larger than seen), should they just be written in a long
numbered list of requirements? A better way to organise the functional
requirements, etc.
To achieve traceabili ty, it is necessary that each functional requirement
should be numbered uniquely and consistently. Proper numbering of the
requirements makes it possible for different documents to uniquely refer to
specific requirements. An example scheme of numbering the functional
requirements is shown in Examples 4.7 and 4.8, where the functional
requirements have been numbered R.1, R.2, etc. and the subrequirements for
the requirement R.1 have been numbered R.1.1, R.1.2, etc.
4.2.10 Organisation of the SRS Document
I n this section, we discuss the organisation of an SRS document as
prescribed by the IEEE 830 standard[IEEE 830]. Please note that IEEE 830
standard has been intended to serve only as a guideline for organizing a
requirements specification document into sections and allows the flexibility of
tailoring it, as may be required for specific projects. Depending on the type of
project being handled, some sections can be omitted, introduced, or
interchanged as may be considered prudent by the analyst. However,
organisation of the SRS document to a large extent depends on the
preferences of the system analyst himself, and he is often guided in this by
the policies and standards being followed by the development company. Also,
the organisation of the document and the issues discussed in it to a large
extent depend on the type of the product being developed. However,
irrespective of the company’s principles and product type, the three basic
issues that any SRS document should discuss are—functional requirements,
non-functional requirements, and guidelines for system implementation.
The introduction section should describe the context in which the system is
being developed, and provide an overall description of the system, and the
environmental characteristics. The introduction section may include the
hardware that the system will run on, the devices that the system will
interact with and the user skill-levels. Description of the user skill-level is
important, since the command language design and the presentation styles of
the various documents depend to a large extent on the types of the users it is
targeted for. For example, if the skill-levels of the users is “novice”, it would
mean that the user interface has to be very simple and rugged, whereas if
the user-level is “advanced”, several short cut techniques and advanced
features may be provided in the user interface.
It is desirable to describe the formats for the input commands, input data,
output reports, and if necessary the modes of interaction. We have already
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
Introduction
Purpose: This section should describe where the software would be
deployed and and how the software would be used.
Project scope: This section should briefly describe the overall context within
which the software is being developed. For example, the parts of a problem
that are being automated and the parts that would need to be automated
during future evolution of the software.
Environmental characteristics: This section should briefly outline the
environment (hardware and other software) with which the software will
interact.
Functional requirements
1. Operation mode 1
(a) Functional requirement 1.1
(b) Functional requirement 1.2
2. Operation mode 2
(a) Functional requirement 2.1
(b) Functional requirement 2.2
Specification of the behaviour may not be necessary for all systems. It is
usually necessary for those systems in which the system behaviour depends
on the state in which the system is, and the system transits among a set of
states depending on some prespecified conditions and events. The behaviour
of a system can be specified using either the finite state machine (FSM)
formalism and any other alternate formalisms. The FSMs can used to specify
the possible states (modes) of the system and the transition among these
states due to occurrence of events.
Example 4.9 (Personal library software): It is proposed to develop a
software that would be used by individuals to manage their personal
collection of books. The following is an informal description of the
requirements of this software as worked out by the marketing department.
Develop the functional and non-functional requirements for the software.
A person can have up to a few hundreds of books. The details of all the
books such as name of the book, year of publication, date of purchase, price,
and publisher would be entered by the owner. A book should be assigned a
unique serial number by the computer. This number would be written by the
owner using a pen on the inside page of the book. Only a registered friend
can be lent a book. While registering a friend, the following data would have
to be supplied—name of the friend, his address, land line number, and mobile
number. Whenever a book issue request is given, the name of the friend to
whom the book is to be issued and the unique id of the book is entered. At
this, the various books outstanding against the borrower along with the date
borrowed are displayed for information of the owner. If the owner wishes to
go ahead with the issue of the book, then the date of issue, the title of the
book, and the unique identification number of the book are stored. When a
friend returns a book, the date of return is stored and the book is removed
from his borrowing list. Upon query, the software should display the name,
address, and telephone numbers of each friend against whom books are
outstanding along with the titles of the outstanding books and the date on
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
which those were issued. The software should allow the owner to update the
details of a friend such as his address, phone, telephone number, etc. It
should be possible for the owner to delete all the data pertaining to a friend
who is no more active in using the library. The records should be stored using
a free (public domain) data base management system. The software should
run on both Windows and Unix machines.
Whenever the owner of the library software borrows a book from his
friends, would enter the details regarding the title of the book, and the date
borrowed and the friend from whom he borrowed it. Similarly, the return
details of books would be entered. The software should be able to display all
the books borrowed from various friends upon request by the owner.
It should be possible for any one to query about the availability of a
particular book through a web browser from any location. The owner should
be able to query the total number of books in the personal library, and the
total amount he has invested in his library. It should also be possible for him
to view the number of books borrowed and returned by any (or all) friend(s)
over any specified time.
Functional requirements
The software needs to support three categories of functionalities as
described below:
4. Manage statistics
R.4.1: Display book count
Description: The total number of books in the personal library should be
displayed.
Input: User selection.
Non-functional requirements
N.1: Database: A data base management system that is available free of
cost in the public domain should be used.
N.2: Platform: Both Windows and Unix versions of the software need to be
developed. N.3: Web-support: It should be possible to invoke the query
book functionality from any place by using a web browser.
Observation: Since there are many functional requirements, the
requirements have been organised into four sections: Manage own books,
manage friends, manage borrowed books, and manage statistics. Now each
section has less than 7 functional requirements. This would not only enhance
the readability of the document, but would also help in design.
4.2.11 Techniques for Representing Complex Logic
A good SRS document should properly characterise the conditions under
which different scenarios of interaction occur (see Section 4.2.5). That
is, a high-level function might involve different steps to be undertaken
as a consequence of some decisions made after each step. Sometimes
the conditions can be complex and numerous and several alternative
interaction and processing sequences may exist depending on the
outcome of the corresponding condition checking. A simple text
description in such cases can be difficult to comprehend and analyse. In
such situations, a decision tree or a decision table can be used to
represent the logic and the processing involved. Also, when the decision
making in a functional requirement has been represented as a decision
table, it becomes easy to automatically or at least manually design test
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
Decision tree
A decision tree gives a graphic view of the processing logic involved in
decision making and the corresponding actions taken. Decision tables
specify which variables are to be tested, and based on this what actions
are to be taken depending upon the outcome of the decision making
logic, and the order in which decision making is performed.
The edges of a decision tree represent conditions and the leaf nodes
represent the actions to be performed depending on the outcome of testing
the conditions. Instead of discussing how to draw a decision tree for a given
processing logic, we shall explain through a simple example how to represent
the processing logic in the form of a decision tree.
Example 4.10 A library membership management software (LMS) should
support the following three options—new member, renewal, and cancel
membership. When the new membe r option is selected, the software should
ask the member’s name, address, and phone number. If proper information is
entered, the software should create a membership record for the new
member and print a bill for the annual membership charge and the security
deposit payable. If the renewal option is chosen, the LMS should ask the
member’s name and his membership number and check whether he is a valid
member. If the member details entered are valid, then the membership
expiry date in the membership record should be updated and the annual
membership charge payable by the member should be printed. If the
membership details entered are invalid, an error message should be
displayed. If the cancel membership option is selected and the name of a valid
member is entered, then the membership is cancelled, a choke for the
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
balance amount due to the member is printed and his membership record is
deleted. The decision tree representation for this problem is shown in Figure
4.3.
Observe from Figure 4.3 that the internal nodes represent conditions, the
edges of the tree correspond to the outcome of the corresponding conditions.
The leaf nodes represent the actions to be performed by the system. In the
decision tree of Figure 4.3, first the user selection is checked. Based on
whether the selection is valid, either further condition checking is undertaken
or an error message is displayed. Observe that the order of condition
checking is explicitly represented.
Decision table
A decision table shows the decision making logic and the corresponding
actions taken in a tabular or a matrix form. The upper rows of the table
specify the variables or conditions to be evaluated and the lower rows
specify the actions to be taken when an evaluation test is satisfied. A
column in the table is called a rule. A rule implies that if a certain
condition combination is true, then the corresponding action is
executed. The decision table for the
LMS problem of Example 4.10 is as shown in Table 4.1.
Table 4.1: Decision Table for the LMS Problem
Conditions
Valid selection NO YES YES YES
New member - YES NO NO
Renewal - NO YES NO
Cancellation - NO NO YES
Actions
Syntactic domains
The syntactic domain of a formal specification language consists of an
alphabet of symbols and a set of formation rules to construct well-
formed formulas from the alphabet. The well-formed formulas are used
to specify a system.
Semantic domains
Formal techniques can have considerably different semantic domains.
Abstract data type specification languages are used to specify algebras,
theories, and programs. Programming languages are used to specify
functions from input to output values. Concurrent and distributed
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
Satisfaction relation
Given the model of a system, it is important to determine whether an
element of the semantic domain satisfies the specifications. This
satisfaction is determined by using a homomorphism known as semantic
abstra c t i o n function. The semantic abstraction function maps the
elements of the semantic domain into equivalent classes. There can be
different specifications describing different aspects of a system model,
possibly using different specification languages. Some of these
specifications describe the system’s behaviour and the others describe
the system’s structure. Consequently, t wo broad classes of semantic
abstraction functions are defined— those that preserve a system’s
behaviour and those that preserve a system’s structure.
Establish the range of input values over which the function should
behave correctly. Establish the constraints on the input parameters as
a predicate.
Specify a predicate defining the condition which must hold on the
output of the function if it behaved properly.
Establish the changes made to the function’s input parameters after
execution of the function. Pure mathematical functions do not change
their input and therefore this type assertion is not necessary for pure
functions.
Combine all of the above into pre- and post-conditions of the function.
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
than the basic construction operators. For example, the operator ‘remove’ in
Example 4.13 is an extra construction operator, because e ven without using
‘remove’ it is possible to generate all values of the type being specified.
Basic inspection operators: These operators evaluate attributes of a type
without modifying them, e.g., eval, get, etc. Let S be the set of operators
whose range is not the data type being specified—these are the inspection
operators. The set of the basic operators S1 is a subset of S , such that each
operator from S -S 1 can be expressed in terms of the operators from S 1.
Extra inspection operators: These are the inspection operators that are
not basic inspectors. A simple way to determine whether an operator is a
constructor (basic or extra) or an inspector (basic or extra) is to check the
syntax expression for the operator. If the type being specified appears on the
right hand side of the expression then it is a constructor, otherwise it is an
inspection operator. For example, in Example 4.13, create is a constructor
because point appears on the right hand side of the expression and point is
the data type being specified. But, xcoord is an inspection operator since it
does not modify the point type.
A good rule of thumb while writing an algebraic specification, is to first
establish which are the constructor (basic and extra) and inspection operators
(basic and extra). Then write down an axiom for composition of each basic
construction operator over each basic inspection operator and extra
constructor operator. Also, write down an axiom for each of the extra
inspector in terms of any of the basic inspectors. Thus, if there are m1 basic
constructors, m2 extra constructors, n1 basic inspectors, a n d n2 extra
inspectors, we should have m1 × (m2 + n1) + n2 axioms. However, it should
be clearly noted that these m1 × (m2 + n1) + n2 axioms are the minimum
required and many more axioms may be needed to make the specification
complete. Using a complete set of rewrite rules, it is possible to simplify an
arbitrary sequence of operations on the interface procedures.
While developing the rewrite rules, different persons can come up with
different sets of equations. However, while dev eloping the equations one has
to be careful that the equations should be able to handle all meaningful
composition of operators, and they should have the unique termination and
finite termination properties. These two properties of the rewrite rules are
discussed later in this section.
Example 4.13 Let us specify a data type point supporting the operations
create, xcoord, ycoord, isequal; where the operations have their usual
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
meaning.
Types:
defines point
uses boolean, integer
Syntax:
1. create : integer × integer → point
2. xcoord : point → integer
3. ycoord : point → integer
4. isequal : point × point → boolean
Equations:
1. xcoord(create(x, y)) = x
2. ycoord(create(x, y)) = y
3. isequal(create(x1, y1), create(x2, y2)) = ((x1 = x2)and(y1 = y2))
In this example, we have only one basic constructor (create), and three
basic inspectors (xcoord, ycoord, and isequal). Therefore, we have only 3
equations.
The rewrite rules let you determine the meaning of any sequence of calls
on the point type. Consider the following expression: isequal (creat e (xcoord
(create(2, 3)), 5),create (ycoord (create(2, 3)), 5)). By applying the rewrite rule 1,
you can simplify the given expression as isequal (create (2, 5), create (ycoord
(create(2, 3)), 5)). By using rewrite rule 2, you can further simplify this as
isequal (create (2, 5),create (3, 5)). This is false by rewrite rule 3.
But, if the right hand side of each rewrite rule has fewer terms than the left,
then the rewrite process must terminate.
Unique termination property: This property indicates whether application
of rewrite rules in different orders always result in the same answer.
Essentially, to determine this property, the answer to the following question
needs to be checked—Can all possible sequence of choices in application of
the rewrite rules to an arbitrary expression involving the interface procedures
always give the same answer? Checking the unique termination property is a
very difficult problem.
Example 4.14 Let us specify a FIFO queue supporting the operations create,
append, remove, first, and isempty; where the operations have their usual
meaning.
Types:
defines queue
uses boolean, element
Exception:
underflow, novalue
Syntax:
1. create : ϕ → queue
2. append : queue × element → queue
3. remove : queue → queue + {underf low}
4. f irst : queue → element + {novalue}
5. isempty : queue → boolean
Equations:
1. isempty(create()) = true
2. isempty(append(q, e)) = f alse
3. f irst(create()) = novalue
4. f irst(append(q, e)) = if isempty(q) then e else f irst(q)
5. remove(create()) = underf low
6 . remove(append(q, e)) = if isempty(q) then create( ) else
append(remove(q), e)
In this example, we have two basic construction operators (create and
append). We have one extra construction operator (remove). We have
considered remove to be an extra construction operator because all values of
the queue can be realised, even without having the remove operator. We
have two basic inspectors (first and isempty). Therefore we have 2 × 3 = 6
equations.
4.5.1 Auxiliary Functions
Sometimes while specifying a system, one needs to introduce extra
functions not part of the system to define the meaning of some
interface procedures. These are called auxiliary functions. In the
following, we discuss an example where it becomes necessary to use an
auxiliary function to be able to specify a system.
Example 4.15 Let us specify a bounded FIFO queue having a maximum size
of MaxSize and supporting the operations create, append, remove, first, and
isempty; where the operations have their usual meaning.
Types:
defines queue
uses boolean, element, integer
Exception:
underflow, novalue, overflow
Syntax:
1. create : ϕ → queue
2. append : queue × element → queue + {overf low}
3. size : queue → integer
4. remove : queue → queue + {underf low}
5. f irst : queue → element + {novalue}
6. isempty : queue → boolean
Equations:
1. f irst(create()) = novalue
2. first(append(q,e)) = if size(q)= MaxSize then overflow else i f isempty(q) then e
else first(q)
3. remove(create()) = underf low
4. remove(append(q, e)) = if isempty(q) then create() else
.
if size(q) = M axS ize then overf low else append(remove(q), e)
5. size(create()) = 0
6. size(append(q, e)) = if size(q) = M axS ize then overf low else size(q) +
1
7. isempty(q) = if (size(q) = 0) then true elsef alse
In this example, we have used the auxiliary function size to enable us to
******ebook converter DEMO - www.ebook-converter.com*******
******Created by ebook converter - www.ebook-converter.com******
specify that during appending an element, overflow might occur if the queue
size exceeds MaxSize. However, after we have introduced the auxiliary
function size, we find that the operator isempty can no longer be considered as
a basic inspector because isempty can be expressed in terms of size.
Therefore, we have removed the axioms for the operator issmpty used in
Example 4.15, and have instead used an axiom to express isempty in terms of
size. We have added two axioms to express size in terms of the basic
construction operators (create and append).