Software Engineering PPT - 3
Software Engineering PPT - 3
Specification
1
Requirements Analysis and
Specification
● Many projects fail:
2
The Fact about Requirements
Engineering
3
The Fact about Requirements
Engineering
4
Requirement Engineering
● The process of establishing the services that the
customer requires from a system and the constraints
under which it operates and is developed.
5
Types of Requirements
● User requirements
– Statements in natural language plus diagrams of
theservices the system provides and its operational
constraints. Written for customers.
● System requirements
– A structured document setting out detailed descriptions of
the system’s functions, services and operational constraints.
Defines what should be implemented so may be part of a
contract between client and contractor. 6
Types of Requirements
7
Functional and non-functional requirements
● Functional requirements
– Statements of services the system should provide, how
the system should react to particular inputs and how the
system should behave in particular situations.
● Non-functional requirements
– Constraints on the services or functions offered by the
system such as timing constraints, constraints on the
development process, standards, etc.
• Domain requirements
9
Requirements imprecision
● In principle, requirements should be both complete and
consistent.
● Complete
– They should include descriptions of all facilities required.
● Consistent
– There should be no conflicts or contradictions in the
descriptions of the system facilities.
10
Non-functional requirements
● These define system properties and constraints e.g. reliability,
response time and storage requirements.
11
Non-functional requirements
● Non-functional requirements may affect the overall
architecture of a system rather than the individual
components.
– For example, to ensure that performance requirements are met, you may
have to organize the system to minimize communications between
components.
12
Non-functional requirements
● Product requirements
– Requirements which specify that the delivered product must behave in a
particular way e.g. execution speed, reliability, etc.
● Organisational requirements
– Requirements which are a consequence of organisational policies and
procedures e.g. process standards used, implementation requirements,
etc.
● External requirements
– Requirements which arise from factors which are external to the
system and its development process e.g. interoperability
requirements, legislative requirements, etc.
13
Non-functional requirements
14
Specifying nonfunctional requirements
15
Domain requirements
● The system’s operational domain imposes
requirements on the system.
– For example, a train control system has to take
into account the braking characteristics in
different weather conditions.
16
Domain requirements
● It is difficult for a non-specialist to understand the
implications of this and how it interacts with other
requirements.
● Understandability
– Requirements are expressed in the language of the
application domain;
● Implicitness
– Domain specialists understand the area so well that they do
not think of making the domain requirements explicit.
17
Requirements Analysis and
Specification
● Goals of requirements analysis and specification
phase:
– Fully understand the user requirements.
– Remove inconsistencies, anomalies, etc. from
requirements.
– Document requirements properly in an SRS
document.
20
Requirements Analysis
● Analyst gathers requirements through:
– Observation of existing systems,
– Studying existing procedures,
– Discussion with the customer and end-users,
– Analysis of what needs to be done, etc.
21
Requirements Gathering
● Also known as requirements elicitation.
● If the project is to automate some existing
procedures
– e.g., automating existing manual accounting
activities,
– The task of the system analyst is a little easier
– Analyst can immediately obtain:
● input and output formats
● accurate details of the operational procedures
22
Requirements Gathering
Activities
1. Studying the existing
documentation
2. Interview
3. Task analysis
4. Scenario analysis
5. Form analysis
23
Requirements Gathering
Activities
Studying the existing documentation:
For example, for the issue book service, the steps may be
authenticate user, check the number of books issued to the
customer and determine if the maximum number of books that
this member can borrow has been reached, check whether the
book has been reserved, post the book issue details in the
member’s record, and finally print out a book issue slip that can
be presented by the member at the security counter to take
the book out of the library premises. 28
Requirements Gathering
Activities
Form analysis:
▪ Form analysis activity is undertaken by the analyst, when the
project involves automating an existing manual system.
▪ During the operation of a manual system, normally several
forms are filled up by the stakeholders.
▪ These exiting forms are analyzed to determine the data
input to the system and the data that are output from the
system.
▪ For the different sets of data input to the system, how
these input data would be used by the system to produce the
corresponding output data is determined from the users.
The details about requirement elicitation techniques can be referred from the Zowghi &
Coulin “Requirements Elicitation: A Survey of Techniques, Approaches, and Tools”. 29
Requirements Gathering
● In the absence of a working system,
– Lot of imagination and creativity are required.
31
Case Study: Automation of
Office Work at CSE Dept.
● The team was first briefed by the HoD about
the specific activities to be automated.
32
Case Study: Automation of
Office Work at CSE Dept.
● For each task, they asked:
– About the steps through which
these are performed.
– They also discussed various
scenarios that might arise for each
task.
– The analyst collected all types of
forms that were being used.
33
Analysis of the Gathered
Requirements
● Main purpose of requirements analysis:
● Clearly understand the user requirements,
● Detect inconsistencies, ambiguities, and
incompleteness.
34
Analysis of the Gathered
Requirements
● It is quite difficult to obtain:
– A clear, in-depth understanding of the problem:
● Especially if there is no working model of the problem.
● Experienced analysts take considerable time:
– To understand the exact requirements the customer has in his
mind.
● Several things about the project should be clearly understood by
the analyst:
– What is the problem?
36
Software Requirements
Specification
● SRS is a document that completely describes what
the proposed software should do without
describing how software do it.
● It contains:
– A complete information description
– A detailed functional description
– A representation of system behaviour
– An indication of performance requirements and design
constrains
– Appropriate validation criteria
– Other information suitable to requirements 37
Properties of a Good SRS
Document
● It should be concise and at the same time should not be
ambiguous.
● It should specify what the system must do and not say how
to do it.
● Easy to change and should be well-structured.
● It should be consistent and unambiguous
● It should be complete
● It should be correct
● It should be ranked for importance
● It should be traceable
● It should be verifiable 38
Examples of Bad SRS
Documents
● Unstructured Specifications:
– One of the worst types of specification
document:
● Difficult to change,
● Difficult to be precise,
● Difficult to be unambiguous,
● Scope for contradictions, etc.
39
Examples of Bad SRS
Documents
● Noise:
– Presence of text containing information
irrelevant to the problem.
● Silence:
– aspects important to proper solution of the
problem are omitted.
40
Examples of Bad SRS
Documents
● Overspecification:
– Addressing “how to” aspects
– For example, “Library member names should be stored in
a sorted descending order”
– Overspecification restricts the solution space for the
designer.
● Contradictions:
– Contradictions might arise
● if the same thing described at several places in different ways.
41
Examples of Bad SRS
Documents
● Ambiguity:
– Literary expressions
– Unquantifiable aspects, e.g. “good user interface”
● Forward References:
– References to aspects of problem
● defined only later on in the text.
● Wishful Thinking:
– Descriptions of aspects
● for which realistic solutions will be hard to find.
42
Template for SRS
Title page
Software Requirements Specification
Version <<Annotated Version>>
<<date>>
Prepared by <<System Analyst details>>
Table of Contents
Revision History
43
Template for SRS
Introduction
– Purpose
– Scope of Project
– Glossary
– References
Overall Description
– Product perspective
– Product features
– Operating environment
– Design and implementation constraints
– Assumptions and Dependencies 44
Template for SRS
System Description
— Functional Requirements Specification
● Use cases
● Use case description
— Non-Functional Requirements
● Performance requirements
● Safety requirements
● Security requirements
● Software quality attributes
— External Interface Requirements
● User interfaces
● Hardware interfaces
● Software interfaces
45
● Communication interfaces
SRS Document
● It is desirable to consider every system:
– Performing a set of functions {fi}.
– Each function fi considered as:
– Transforming a set of input data to
corresponding output data.
46
Example: Functional
Requirement
● F1: Search Book
– Input:
● an author’s name:
– Output:
● details of the author’s books and the locations of
these books in the library.
47
Functional Requirements
● Functional requirements describe:
– A set of high-level requirements
– Each high-level requirement:
● takes in some data from the user
● outputs some data to the user
– Each high-level requirement:
● might consist of a set of identifiable
functions
48
Example Functional
Requirements
● List all functional requirements
– with proper numbering.
● Req. 1:
– Once the user selects the “search” option,
● he is asked to enter the key words.
– The system should output details of all books
● whose title or author name matches any of the key
words entered.
● Details include: Title, Author Name, Publisher name,
Year of Publication, ISBN Number, Catalog Number,
Location in the Library. 49
Req. 1:
● R.1.1:
– Input: “search” option,
– Output: user prompted to enter the key words.
● R1.2:
– Input: key words
– Output: Details of all books whose title or author
name matches any of the key words.
● Details include: Title, Author Name, Publisher name, Year of
Publication, ISBN Number, Catalog Number, Location in the
Library.
– Processing: Search the book list for the keywords
50
Example Functional Requirements
● Req. 2:
– When the “renew” option is selected,
● The user is asked to enter his membership
number and password.
– After password validation,
● The list of the books borrowed by him are
displayed.
– The user can renew any of the books:
● By clicking in the corresponding renew box.
51
Req. 2:
● R2.1:
– Input: “renew” option selected,
– Output: user prompted to enter his membership number
and password.
● R2.2:
– Input: membership number and password
– Output:
● list of the books borrowed by user are displayed. User prompted
to enter books to be renewed or
● user informed about bad password
– Processing: Password validation, search books issued to
the user from borrower list and display. 52
Req. 2:
● R2.3:
– Input: user choice for renewal of the books
issued to him through mouse clicks in the
corresponding renew box.
– Output: Confirmation of the books renewed
– Processing: Renew the books selected by the
in the borrower list.
53
Req. 2:
● R2.3:
– Input: user choice for renewal of the books
issued to him through mouse clicks in the
corresponding renew box.
– Output: Confirmation of the books renewed
– Processing: Renew the books selected by the
in the borrower list.
54
Nonfunctional Requirements
● Characteristics of the system
which can not be expressed as
functions:
● Maintainability,
● Portability,
● Usability, etc.
55
Nonfunctional Requirements
● Non-functional requirements include:
– Reliability issues,
– Performance issues:
● Example: How fast the system can produce results
– so that it does not overload another system to
which it supplies data, etc.
– Human-computer interface issues,
– Interface with other external systems,
– Security, maintainability, etc.
56
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.
57
Representation of complex
processing logic:
● Sometimes the conditions in functional
requirements can be complex.
● 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 analyze.
● In such situations, we use
– Decision trees
– Decision tables
58
Decision Trees
● Decision trees:
– A graphical representation
– Edges of a decision tree represent conditions
– Leaf nodes represent actions to be performed.
59
Example: LMS
● A Library Membership automation
Software (LMS) should support the
following three options:
– New member,
– Renewal,
– Cancel membership.
60
Example: LMS
● When the new member option is selected,
– The software asks details about the member:
● name,
● address,
● phone number, etc.
● If proper information is entered,
– A membership record for the member is created
62
Example(cont.)
● If the cancel membership option is
selected and the name of a valid
member is entered,
– The membership is cancelled,
– A cheque for the balance amount due to
the member is printed
– The membership record is deleted.
63
Decision Tree
64
Decision Table
● Decision tables specify:
– Which variables are to be tested
– What actions are to be taken if the
conditions are true,
– The order in which decision making
is performed.
65
Decision Table
● A decision table shows in a tabular form:
– Processing logic and corresponding actions
● Upper rows of the table specify:
– The variables or conditions to be evaluated
● Lower rows specify:
– The actions to be taken when the
corresponding conditions are satisfied.
66
Decision Table
● In technical terminology,
– a column of the table is called a
rule:
– A rule implies:
● if a condition is true, then execute the
corresponding action.
67
Example:
68
Comparison
● Both decision tables and decision trees
– Can represent complex program logic.
● Decision trees are easier to read and
understand
– When the number of conditions are small.
● Decision tables help to look at every
possible combination of conditions.
69
Summary
● Requirements analysis and specification
– An important phase of software
development:
– Any error in this phase would affect all
subsequent phases of development.
● Consists of two different activities:
– Requirements gathering and analysis
– Requirements specification
70
Summary
● The aims of requirements analysis:
– Gather all user requirements
– Clearly understand exact user requirements
– Remove inconsistencies and incompleteness.
● The goal of specification:
– Systematically organize requirements
– Document the requirements in an SRS
document.
71
Summary
● Main components of SRS document:
– Functional requirements
– Non-functional requirements
– Constraints
● Techniques to express complex logic:
– Decision tree
– Decision table
72
Summary
● Formal requirements
specifications have several
advantages.
– But the major shortcoming
is that these are hard to
use.
73