LECT-3 Requirement Analysis
LECT-3 Requirement Analysis
1 2 3
25 26
31 32 33
Example Functional
Example Functional Requirements Req. 1:
Requirements
List all functional requirements Req. 2: R.1.1:
with proper numbering. Input: “search” option,
When the “renew” option is selected, Output: user prompted to enter the key words.
Req. 1: the user is asked to enter his
Once the user selects the “search” R1.2:
option, membership number and password. Input: key words
he is asked to enter the key words. After password validation, Output: Details of all books whose title or author
The system should output details of all name matches any of the key words.
the list of the books borrowed by him are Details include: Title, Author Name, Publisher name, Year
books displayed. of Publication, ISBN Number, Catalog Number, Location in
whose title or author name matches any of the Library.
the key words entered. The user can renew any of the books: Processing: Search the book list for the keywords
Details include: Title, Author Name, by clicking in the corresponding renew
Publisher name, Year of Publication, ISBN
Number, Catalog Number, Location in the box.
Library. 34 35 36
Examples of Bad SRS Documents
Req. 2: Req. 2:
Unstructured Specifications:
R2.1: Narrative essay --- one of the worst types of
Input: “renew” option selected, specification document:
Output: user prompted to enter his R2.3: Difficult to change,
membership number and password. Input: user choice for renewal of the
R2.2: difficult to be precise,
Input: membership number and password books issued to him through mouse difficult to be unambiguous,
Output: clicks in the corresponding renew box. scope for contradictions, etc.
list of the books borrowed by user are displayed.
User prompted to enter books to be renewed or Output: Confirmation of the books Noise:
user informed about bad password Presence of text containing information irrelevant to
Processing: Password validation, search renewed
books issued to the user from borrower list the problem.
and display. Processing: Renew the books selected Silence:
by the in the borrower list. aspects important to proper solution of the problem
37 38 are omitted. 39
-Create record
a cheque for the balance amount - Delete record
46 47
Decision Tree as we understand Decision table
Decision tables are a concise visual
representation for specifying which actions to
perform depending on given conditions.
They are algorithms whose output is a set of
actions.
The information expressed in decision tables
could also be represented as decision trees or in
a programming language as a series of if-then-
else and switch-case statements.
Example: Comparison
Conditions
Valid selection NO YES YES YES Both decision tables and decision trees
New member -- YES NO NO can represent complex program logic.
Renewal -- NO YES NO
Cancellation -- NO NO YES Decision trees are easier to read and
Actions understand
Display error message -- -- --
when the number of conditions are small.
Ask member's name etc.
Build customer record -- -- -- Decision tables help to look at every
Generate bill -- -- possible combination of conditions.
Ask membership details --
Update expiry date -- -- --
Print cheque -- -- --
Delete record -- -- -- 59 60
Formal Specification Formal Specification
A formal software specification is a statement
A formal specification technique expressed in a language whose vocabulary,
syntax, and semantics are formally defined.
is a mathematical method to:
accurately specify a system The need for a formal semantic definition means
verify that implementation that the specification languages cannot be
based on natural language;
satisfies specification
prove properties of the It must be based on mathematics.
specification
61 62
The scope of formal methods is limited. They are not well-suited to Formal methods have limited practical applicability
specifying and analysing user interfaces and user interaction
68 69
Structured specification languages If specification is expressed in formal Executable specifications only test
SADT (Structured Analysis and Design functional requirements:
Technique)
language:
it becomes possible to execute the If non-functional requirements are
PSL/PSA (Problem Statement
specification to provide a system important for some product,
Language/Problem Statement Analyzer)
PSL is a semi-formal specification language prototype. the utility of an executable
PSA can analyze the specifications However, executable specifications specification prototype is limited.
expressed in PSL are usually slow and inefficient.
70 71 72
4GLs 4GLs Summary
Requirements analysis and specification
4GLs (Fourth Generation Languages) are 4GLs rely on software reuse
examples of an important phase of software development:
where common abstractions have been
identified and parameterized. any error in this phase would affect all
executable specification languages. subsequent phases of development.
Eg. SQL, Mathematica
Rewriting 4GL programs in higher level
languages: Consists of two different activities:
4GLs are successful Requirements gathering and analysis
result in upto 50% lower memory
because there is a lot of commonality requirements Requirements specification
across data processing applications. also the programs run upto 10 times faster.
73 74 75