Requirements Engg
Requirements Engg
Requirements Engg
4 5
6
Requirements…
• Software requirements specify what the software must do to
meet the business needs.
• For example, a stores manager might state his
requirements in terms of efficiency in stores management.
• A bank manager might state his requirements in terms of
time to service his customers.
• It is the analyst's job to understand these requirements and
provide an appropriate solution.
• To be able to do this, the analyst must understand the
client's business domain: who are all the stake holders, how
they affect the system, what are the constraints, etc
7
Requirements…
• The analyst should not blindly assume that only a
software solution will solve a client's problem.
• He should have a broader vision.
• Sometimes, re-engineering of the business processes
may be required to improve efficiency
• A detailed statement of what the software must do to
meet the client's needs should be prepared. This
document is called Software Requirements
Specification (SRS) document.
8
SOURCES OF REQUIRMENTS
9
Template for SRS
1. Introduction
1.1 Purpose of requirements document
1.2 Scope of the product
1.3 Definitions, acronyms and abbreviations
1.4 References
1.5 Overview of the remainder of the document
2. General description
2.1 Product perspective
2.2 Product functions
2.3 User characteristics
2.4 General constraints
2.5 Assumptions and dependencies
3. Specific requirements covering functional, non-functional and
interface requirements.
4. Appendices 10
5. Index
SOFTWARE REQUIREMENTS SPECIFICATIONS
16
Ambiguities
• What is a Library ?
• Who is a user ?
• Confusion regarding “ Book ” and “ Copy ”
• What does “ Available ” mean ?
• What do “ Last Checked Out ” and “ Currently ” mean ?
Incompleteness
• Initialization
• Addition of a new book
• Remove all copies of a book
• Create a library
• Add a staff user / ordinary user
• Error Handling
• Missing Constraints
– Period of Lending
– Not more than one copy of the same book can be borrowed
17
Further Examples for Bad Specification
• The counter value is picked up from the last record.
• Inversion of a square, matrix ‘M’ of size ‘n’ such as LM
ML = In, where ‘L’ is the inverse matrix and In is the
identity matrix of size ‘n’.
• The software should be highly user friendly
• The output of the program shall usually be given within 10
seconds.
• The software should be developed on DOS system, but
should be portable to other systems.
18
Further Examples for Bad Specification
• In first statement, the word 'last' is ambiguous. It could mean the
last accessed record, which could be anywhere in a random
access file, or, it could be physically the last record in the file
• Second statement though appears to be complete, is missing on
the type of the matrix elements. Are they integers, real numbers,
or complex numbers. Depending on the answer to this question,
the algorithm will be different.
• How does one determine, whether this requirement is satisfied
or not.
• What are the exceptions to the 'usual 10 seconds' requirement?
19
How Users and Developers view each other ?
70
60
50 49 %
40
31 %
30
20 13 %
10 5%
2%
100
R
E 50
L
A 20
T
I
V 10
E
5
C
O
S 0.5
T
0.2
0.1
DEVELOP- ACCEP-
REQUIREMENT DESIGN CODE OPERA-
MENT TANCE
TEST TION 22
TEST
The Requirements Definition and Analysis Phase is
Critical to keep the Development and Maintenance Costs
to a Minimum
Types Of Requirements
• Functional Requirements
- what system should do
The requirements that specify the Inputs (Stimuli) to the system, the Outputs
(Responses) from the system, and the behavioral relationship between them
• Non-Functional Requirements
- specify the overall quality attributes the system must satisfy.
23
Functional Requirements (Examples)
• Portability • Security
• Reliability • Presentation
• Performance • Reusability
• Testability • Understandability
• Modifiability • Acceptance
Criteria
25
Non-Functional Requirements (Examples)
Performance
• Number of significant digits to which accuracy should be
maintained in a numerical solution
• Maximum response time in a transaction processing system
• Delays and task completion time limits in a real-time system
Environment
• To run the software under a given operating system or use a
specific programming language
Security
• The addition and deletion of the book in the system can be
carried out by the Library-Chief only
26
Types of Satisfiability
• Normal Requirements
* User responses to specific questions
* Satisfy / dissatisfy in proportion to their
presence / absence in system
• Expected Requirements
• Exciting Requirements
27
Expected Requirements
28
Exciting Requirements
Normal
Exciting
Dissatisfaction 30
31
Modeling Requirements
32
SSADM tools
33
Points to remember
34
Points to remember
35
• 6) Do not show dataflow between two data stores.
There should be a process in between.
36
• 7) There should not be any unconnected external agent,
process, or data store.
• 8) Beware of read-only or write-only data stores
37
• 9) Beware of processes which take inputs
without generating any outputs. Also, beware
of processes which generate outputs
spontaneously without taking any inputs
38
• 10) Ensure that the data flowing in to a process exactly
matches the data flowing in to the exploded view of that
process. Similarly for the data flowing out of the process.
• 11) Ensure that the data flowing out of a data store
matches data that has been stored in it before.
39
DECISION TREE
• A decision tree represents complex decisions in the form of a
tree. Though visually it is appealing, it can soon get out of
hand when the number and complexity of decisions increase.
An example is given below.
First the textual statement is given and then the
corresponding decision tree is given:
Rules for electricity billing are as below:
• If the meter reading is "OK", calculate on consumption
basis(i.e. meter reading)
If the meter reading appears "LOW", then check if the house
is occupied
If the house is occupied, calculate on seasonal consumption
basis otherwise calculate on consumption basis
If the meter is damaged, calculate based on maximum
possible electricity usage
40
DECISION TREE
consumption basis
if house empty calculate
if meter reading
41
DECISION TABLE
• There are two types of decision tables, binary-valued(yes or
no) and multi-valued. An example follows:
42
BINARY VALUED DECISION TABLE
Domestic Customer Y Y N N
Minimum Rate Y N N N
Special Rate N Y N N
RATE S M 2S 2M
44
• Like decision trees, binary-value decision tables can grow
large if the number of rules increase. Multi-valued decision
tables have an edge. In the above example, if we add a new
class of customers, called Academic, with the rules:
45
BINARY VALUED DECISION TABLE
ACADEMIC N N N N Y Y
DOMESTIC CUSTOMER Y Y N N N N
CONSUMPTION < 300UPM Y N Y N Y N
MINIMUM RATE Y N N N N N
SPECIAL RATE N Y N N N N
TWICE MINUMUM RATE N N Y N N N
TWICE SPECIAL RATE N N N Y N N
CONCESSION RATE N N N N Y N
46
TWICE CONCESSION RATE N N N N N Y
MULTIVALUED DECISION TABLE
CUSTOME DOMESTIC DOMESTIC NONDOME NONDOME ACADEMIC ACADEM
STIC STIC IC
R
47
Requirements and design
• In principle, requirements should state what
the system should do and the design should
describe how it does this
• In practice, requirements and design are
inseparable
48
What Case Tools Can Do ?
49
What Case Tools Can Do ?
• Code Generators
• Cost-Benefit Analysis Tools
• Project Management Tools
• Configuration Management Tools
• Documentation Assemblers
– Technical and Non-Technical
– With Interfaces to popular Word Processors
• Test Data Generators
• Path Coverage Analyzers
Data-Flow diagrams
External Entity
Or (A source of data to the system
or a destination from the system)
Identifier
Process
1 (This represents one or more
Or activities which modify data)
Data Flow
(Represents passage of data
between processes)
Duplication Identifier
Symbol
Data Store 52
D1 (Represents a place where data
is kept within the system)
Data-Flow diagrams
Level of DFDs
• Level 0 - Overview showing scope
(5-10 subsystems/processes)
Level 0
56
CUSTOMER DATA
Data-Flow diagrams
Sample Level 1 DFD - Process Orders
Level 1
1 4
Valid orders Assemble Purchase req.
order Verify Req. to
CUST. Order Publisher PUB.
Batched
orders
Credit
status
D4 PENDING ORDERS
57
D3 CUSTOMERS
Data-Flow diagrams
Sample Level 2 DFD – Handling Shipments from
Publishers
Level 2
D1 BOOK DATA D2 PUBLISHER DATA
Book details address
1 4
Valid orders Assemble Purchase req.
order Verify
CUST. Req. to
Order Publisher PUB.
Batched
orders
Credit
status Purchase req.
D4 PENDING ORDERS
D3 CUSTOMERS Orders
by D5 PUBLISHER ORDERS
address title
Shipping P.O. details
note 6
2 5
Fillable orders Titles, qtys Shipping note
Assemble Assign Verify
Customer Shipment to
Orders Pending shipment 58
orders
Data-Flow diagrams Sample Case Study - 1
Problem Statement:
Mr. Roy Chowdry, a restaurant owner feels that is business can do better when the existing operations in the system are automated.
Steps involved in constructing a DFD
1.
Identify the client and the potential users of the system
2.
Observe the client practices and design a context diagram for the same
3.
Identify and establish the goals of the proposed system
4.
Identify the major files in the system
5.
Identify the major processes in the system
6.
Construct a DFD
Data-Flow diagrams
Potential Users:
– Waiters, cash register operator
Data-Flow diagrams
Constructing a DFD – Step 2
• The context diagram for the restaurant:
Order for supplies
Supplies
SUPPLIER Information
supplies
Menu
Payment RESTAURANT
Orders
Sales
Receipt Information
Final Bill
CUSTOMER
Served Bills
Data-Flow diagrams
Constructing a DFD – Step 3
Goals to be achieved:
• Automate much of the order processing and billing
• Automate accounting
• Make supply ordering accurate so as to ensure that:
– The leftovers at the end of the day are minimized
– The rejected orders due to non availability are also minimized
– Supplies file
– Accounting file
– Orders file
– Menu file
Data-Flow diagrams
Constructing a DFD – Step 5
• Major Processes in the system
– Process Supplies
– Make Dishes
– Process Order
– Produce Bill
– Payment Receipt
– Place Supply Order
– Check for discrepancy
– Supplies Payment
– Check for discrepancy
– Accounting reports
– Statistics
Data-Flow diagram: The Final Step - DFD
Data dictionary
Design constraints
• Data acquisition at specified intervals
• Analysis within specified execution time
• Updating of traffic database at defined intervals
• Controller interaction must not slow down other system functions
Data-Flow diagrams DFD Level 0 for ATCS
Controller display
Aircraft
Display
information
Queries
Traffic
database
Data-Flow diagrams DFD - Level 1 for ATCS
Data-Flow diagrams Task architecture
Data-Flow diagrams
Mapping of functions
• HW task does the following
– Generating timer events
– Handling signal from aircraft
– Generating interrupt on controller interactions
• Analysis task does the following
– Processes the signal information to obtain the aircraft information.
– Queues the information for updating database.
• Database updates task does the following
– Reads the aircraft information
– Updates the traffic database
• Controller interface task does the following
– Reads the queries from controller and validates them
– Fetches information from the traffic database
– Displays the response for the controller
Entity-Relationship Diagrams
• A pictorial representation of entities, their attributes and the
relationships between the entities.
What are entities in ERD?
Attributes in ERD
Entity
Dependant/Sub Entity
Attribute
Entity-Relationship Diagrams
Symbols used in ERD
• There can be different types of relationships between entities
• Relationships are depicted using the notations given below:
• Entity A is associated with exactly one instance of entity B
(Also, called a one-one relationship)
A B
Entity-Relationship Diagrams
Symbols used in ERD
A B
Entity-Relationship Diagrams
Symbols used in ERD
A B
Entity-Relationship Diagrams
Symbols used in ERD
A B
Entity-Relationship Diagrams
Symbols used in ERD
A B
Entity-Relationship Diagrams
Sample Case Study
– The bank offers two types of accounts – Savings account and Fixed Deposit
account. An account can be held by more than one customer, and a customer
can have more than one account
– The branch decides on the loans to be issued to one or more customers. A loan
is identified by a unique Loan Number.
– For each loan, the bank keeps track of the loan amount. Apart from this, the
branch also maintains the payment details of the loan like Payment Number for
each loan, the date and amount for each payment.
– The bank also maintains the personal as well as the transactional details of its
customers and employees
– Note: A payment can exist only if there is a loan.
Entity-Relationship Diagrams: ERD for the
Banking System
82
Question 1 : Suppose you are given the following requirements for a
simple database for the National Hockey League (NHL):
Transition
Condition condition
Action
action
State Transition Diagrams
A Sample State Transition Diagram
Other Change Return
Store Empty Change Holder
NULL
50c
Change Return
Choice - Cola Store
Dispense Change
Dispense-Cola
50 CENT
50c
Choice- Beer
Store
$1 Dispense- Beer
Store
$1 Change Return
Dispense Change
• Construct a State Transition Diagram