Professional Documents
Culture Documents
3 Requirements New
3 Requirements New
Requirements
Chapter include
Requirements
Background
Problem of scale is a key issue for SE For small scale, understand and specifying requirements is easy For large problem - very hard; probably the hardest, most problematic and error prone Input : user needs in minds of people Output : precise statement of what the future system will do
Requirements 3
Background..
Identifying and specifying req necessarily involves people interaction Cannot be automated Requirement (IEEE)= A condition or capability that must be possessed by a system Req. phase ends with a software requirements specification (SRS) document SRS specifies what the proposed system should do
Requirements 4
Background..
Visualizing a future system is difficult Capability of the future system not clear, hence needs not clear Requirements change with time
Requirements
SRS establishes basis of agreement between the user and the supplier.
Users needs have to be satisfied, but user may not understand software. Developers will develop the system, but may not know about problem domain SRS is the medium to bridge the commn. gap and specify user needs in a manner both can understand
Requirements 6
users do not always know their needs must analyze and understand the potential The req process helps clarify needs
Requirements
Requirement errors get manifested(clear) in final sw to satisfy the quality objective, must begin with high quality SRS Requirements defects are not few An error that remains in the requirements will be detected in the later phases with the following probabilities : 0.4 in design 0.1 in coding and unit testing 0.4 in acceptance testing 0.1 during operation and maintenance
Requirements
Contd..
Approximate average cost of fixing requirement error depending on the phase shown below Phase requirements Design coding Acceptance test Operation & maint. Cost(person-hours) 2 5 15 50 150
Expected cost of fixing a requirement error that is not removed during the requirements phase is 0.4 * 5 + 0.1 * 15 + 0.4 * 50 + 0.1 * 150= 38.5person-hours So expected effort required to detect and remove an error during the requirements phase is less than this.
Requirements 9
SRS errors are expensive to fix later Req. changes can cost a lot (up to 40%) Good SRS can minimize changes and errors Substantial savings; extra effort spent during req. saves multiple times that effort
Requirements
10
Requirements Process
Sequence of steps that need to be performed to convert user needs into SRS Process has to elicit needs(draw out) and requirements and clearly specify it Basic activities
Requirements Process..
Requirements
12
Requirement process..
Process is iterative and parallel Overlap between phases - some parts may be analyzed and specified Specification itself may help analysis Validation can show gaps that can lead to further analysis and spec
Requirements
13
Requirements Process
Focus of analysis is on understanding the desired systems and its requirements Divide and conquer is the basic strategy
decompose into small parts, understand each part and relation between parts
organizing them is a key
Techniques like data flow diagrams, object diagrams etc. used in the analysis
Requirements 14
Requirements Process..
in specs, external behavior specified during analysis, structure and domain are understood analysis structures helps in specification, but the transition is not final methods of analysis are similar to that of design, but objective and scope different analysis deals with the problem domain, whereas design deals with solution domain
Requirements 15
Problem Analysis
Aim: to gain an understanding of the needs, requirements, and constraints on the software Analysis involves
interviewing client and users reading manuals studying current systems helping client/users understand new possibilities Like becoming a consultant
16
Problem Analysis
Some issues
Obtaining the necessary information Brainstorming: interacting with clients to establish desired properties Information organization, as large amount of info. gets collected Ensuring completeness Ensuring consistency Avoiding internal design
Requirements 17
The understanding obtained from problem analysis forms basis for this activity. Large amount of information and knowledge obtained is organized in a clear document SRS
Requirements
18
Requirement validation
This activity ensures that the requirements specified in SRS are indeed all the requirements of software and making sure that SRS is of good quality Any shortcomings in the specification activity/ validation activity need to go back to analysis activity/specification activity
Requirements
19
Requirements
20
No defined methodology; info obtained through analysis, observation, interaction, discussions, No formal model of the system built Obtained info organized in the SRS; SRS reviewed with clients Relies on analyst experience and feedback from clients in reviews Useful in many contexts
Requirements 21
Widely used; focuses on functions performed in the system Views a system as a network of data transforms through which the data flows Uses data flow diagrams (DFDs) and functional decomposition in modeling The SA methodology uses DFD to organize information, and guide analysis
Requirements 22
Views system as transforming inputs to outputs Transformation done through transforms DFD captures how transformation occurs from input to output as data moves through the transforms Not limited to software
Requirements 23
DFD
Transforms represented by named circles/bubbles Bubbles connected by arrows on which named data travels A rectangle represents a source or sink and is originator/consumer of data (often outside the system)
Requirements 24
DFD Example
Requirements
25
DFD Conventions
External files shown as labeled straight lines Need for multiple data flows by a process represented by * (means and) OR relationship represented by + All processes and arrows should be named Processes should represent transforms, arrows should represent some data
Requirements
26
Focus on what transforms happen , how they are done is not important Usually major inputs/outputs shown, minor are ignored in this modeling No loops , conditional thinking , DFD is NOT a control chart, no algorithmic design/thinking Sink/Source , external files
Requirements 27
Drawing a DFD
If get stuck , reverse direction If control logic comes in , stop and restart Label each arrows and bubbles Make use of + & * Try drawing alternate DFDs Leveled DFDs(detailed) : DFD of a system may be very large Can organize it hierarchically Start with a top level DFD with a few bubbles then draw DFD for each bubble Requirements Preserve I/O when exploding
28
Identify inputs, outputs, sources, sinks for the system Work your way consistently from inputs to outputs, and identify a few high-level transforms to capture full transformation If get stuck, reverse direction When high-level transforms defined, then refine each transform with more detailed transformations
Requirements 29
Never show control logic; if thinking in terms of loops/decisions, stop & restart Label each arrows and bubbles; carefully identify inputs and outputs of each transform Make use of + & * Try drawing alternate DFDs
Requirements 30
Leveled DFDs
DFD of a system may be very large Can organize it hierarchically Start with a top level DFD with a few bubbles then draw DFD for each bubble Preserve I/O when exploding a bubble so consistency preserved Makes drawing the leveled DFD a top-down refinement process, and allows modeling of large and complex systems
Requirements 31
Data Dictionary
In a DFD arrows are labeled with data items Data dictionary defines data flows in a DFD Shows structure of data; structure becomes more visible when exploding Can use regular expressions to express the structure of data
Requirements
32
Weekly_timesheet = employee_name + id + [regular_hrs + overtime_hrs]* Pay_rate = [hourly | daily | weekly] + dollar_amt Employee_name = last + first + middle Id = digit + digit + digit + digit
Requirements 33
Unlabeled data flows Missing data flows Extraneous data flows Consistency not maintained during refinement Missing processes Too detailed or too abstract Contains some control information
Requirements 34
Structured system analysis and design (SSAD) we will focus only on analysis Was used a lot when automating existing manual systems Main steps
Draw a context diagram Draw DFD of the existing system Draw DFD of the proposed system and identify the man-machine boundary
Requirements 35
Context Diagram
Views the entire system as a transform and identifies the context lists all major i/ps and o/ps for s/m Is a DFD with one transform (system), with all inputs, outputs, sources, sinks for the system identified
Requirements
36
The current system is modeled as-is as a DFD to understand the working The context diagram is refined Each bubble represents a logical transformation of some data Leveled DFD may be used Generally obtained after understanding and interaction with users Validate the DFD by walking through with users
Requirements 37
No general rules for drawing the DFD of the future system Use existing system understanding DFD should model the entire proposed system - process may be automated or manual validate with the user Then establish man-machine boundary
Requirements
39
Requirements
40
Requirements
41
Other Approaches to RA
Object Oriented
Classes, attributes, methods Association between classes Class hierarchies The OOD approach is applied, except to the problem domain
Requirements
42
S/m viewed as set of objects Goal- identify the objects, define classes and identify relationships between them. Each obj has certain attributes. Class diagram represent a structure of prob graphically using a precise notation.
Requirements 43
Requirements
44
Requirements
45
Performing analysis
Identify objects and classes Identifying structures Identifying attributes Identifying associations Defining services
Requirements
46
Requirements
47
Requirements
48
Prototyping
Software prototype is a partial implementation of a system whose purpose is to learn something about the problem being solved or the solution approach Used for development of new sysytem There are two approaches 1. throwaway prototype Requirements 49 2. Evolutionary prototype
Prototypying
Throwaway prototype is constructed with the idea of discarding after the analysis is complete and the final system will be built from scratch In evolutionary prototype is built with the idea that it will eventually be converted into the final system For problem analysis, throwaway prototype is built. Requirements
50
Requirements Specification
Final output of requirements task is the SRS Why are DFDs, OO models, etc are not treated as part of SRS ?
SRS focuses on external behavior, while modeling focuses on problem structure UI etc. not modeled, but have to be in SRS Error handling, constraints etc. also needed in SRS
Transition from analysis to specification is not straight forward knowledge about the system acquired in analysis used in specification Requirements
51
Characteristics of an SRS
Correct Complete Unambiguous Consistent Verifiable Traceable Modifiable Ranked for importance and/or stability
Requirements 52
Characteristics
Correctness
Each requirement accurately represents some desired feature in the final system
Completeness
All desired features/characteristics are specified Hardest to satisfy Completeness and correctness strongly related Correctness is easy to achieve than completeness
Each req has exactly one meaning natural languages often used which are inherently ambiguous Requirements
Unambiguous
53
Characteristics
Verifiability There must exist a cost effective way of checking if sw satisfies requirements Ambiguous requirements are not verifiable Verification of requirements is always done through reviews Non-verifiable always include statement such as work well, good human interface, and shall usually happen Example for verifiable statement is that output of the program shall be produced within 20 seconds of event x takes 60% of the time
Requirements 54
Contd
Consistent
two requirements dont contradict each other There are 3 types of conflicts in the SRS
1. The specified characteristics of real world objects may conflict. Ex: (a) The format of output may be described as tabular in one requirement and as textual in another requirement (b) one requirement may state that all lights shall be green while another states that all lights shall be blue 2. There may be logical or temporal conflict between two specified actions
Requirements 55
(a) one requirement may specify that the program will add two i/p and another may specify that program will multiply them (b) one requirement says that A must always follow B. While another requirement say that A & B occur simultaneously (3) Two or more requirements may describe the same real world object but use different terms for that object ex: user input may be called as prompt in one requirement and a cue in another.
Requirements 56
Traceable(Ensures completeness) SRS is traceable if the origin of the req. is clear and the req relates to software elements Associating req with work prod. Backward traceability : trace the design and code elements to the requirements they support. Forward traceability : means that each requirement should be traceable to some design and code elements to the requirements they support
Requirements
57
Forward traceability Sources of the req -reqts - Work products that implement the reqts
Backward traceability Sources of the req reqts Work products that implement the reqts
Requirements 58
Ranked for importance/stability Needed for prioritizing in construction Generally all requirements for software are not of equal importance Some are critical , other are important but not critical Some are desirable but not very imortant Some requirements are not likely to change but some are more dependent on time.
Requirements
59
Modifiable
SRS is modifiable if its structure and style are such that any necessary change can be made easily while preserving completeness and consistency
Requirements
60
Components of an SRS
Clarifying this will help ensure completeness Functionality Performance Design constraints External interfaces
Requirements 61
Functional Requirements
Heart of the SRS document Specifies all the functionality that the system should support Specifies what Outputs should be produced from the given inputs and the relationship between them All operations the system is to do Must specify behavior for invalid inputs too
Requirements 62
Performance Requirements
All the performance constraints on the software system Performance requirements can be static or dynamic Static requirements do not impose constraint on the execution characteristics of the system, also called capacity requirements Ex: requirements like number of terminals to be supported Ex: number of simultaneous users to be supported Ex: number of files that the system has to process and their sizes.
Requirements 63
Dynamic requirements specify constraints on the execution behavior of the system Generally include on response time , throughput Must be in measurable terms (verifiability) Ex resp time of an command should be less than 1 second 90% of the time
Requirements
64
Design Constraints
Factors in the client environment that restrict the choices of a designer Some such restrictions Standard compliance and compatibility with other systems Hardware Limitations Reliability, fault tolerance, backup req.: reliability requirements are very important for critical systems. Fault tolerance requirements make the system make the system more complex and expensive.
Requirements 65
Security very important in defense system and many database systems. these also place restrictions on the use of certain commands, control access to data, provide different kinds of access requirements for different people.
Requirements
66
External Interface
All interactions of the software with people, hardware, and sw User interface most important These should also be verifiable
Requirements
67
Specification Language
Language should support desired char of the SRS Formal languages are precise and unambiguous but hard Natural languages mostly used, with some structure for the document Formal languages used for special features or in highly critical systems
Requirements 68
Structure of an SRS
3. Specific requirements
3.1 External interfaces 3.1.1 User interfaces 3.1.2 Hardware interfaces 3.1.3 Software interfaces 3.1.4 communication interfaces 3.2 Functional requirements 3.3 Performance requirements 3.4 Design constraints 3.5 Attributes 3.6 other requirements Requirements
70
Traditional approach for fn specs specify each function Use cases is a newer technique for specifying behavior (functionality) UCs specify functional requirements Though primarily for specification, can be used in analysis and elicitation Well suited for interactive systems Helps to understand the system in user perspective
Requirements 71
Basics
UCs specify functionality by describing interactions between actors and system A use case captures a contract between a user and system about behavior Focuses on external behavior UCs are primarily textual
An actor is a user of the system playing a particular role. Actor is shown with a stick figure.
employer
client
Basics..
Actor: a person or a system that interacts with the proposed system to achieve a goal
Eg. User of an ATM (goal: get money); Actor is a logical entity, so receiver and sender actors are different (even if the same person)
Use case is a particular activity a user can do on the system. Is represented by an ellipse. Following are two use cases for a library system.
Borrow Reserve
Actors may be connected to use cases by associations(st line), indicating that the actor and the use case communicate with one another using messages.
updating grades faculty
Story like description easy to understand by both users and analysts They do not form the complete SRS, only the functionality part. Use case description consists of scenarios.
Requirements
77
Basics..
Actions specified as a sequence of steps A step is a logically complete action performed either by the actor or the system
Main success scenario when things go normally and the goal is achieved Alternate/Extension/Exception scenarios: When things go wrong and goals cannot be achieved
Requirements
78
Basics..
A UC is a collection of many such scenarios A scenario may employ other use cases in a step I.e. a sub-goal of a UC goal may be performed by another UC I.e. UCs can be organized hierarchically
Title or Reference Name Author/Date Modification/Date Purpose Overview Cross References Actors Pre Conditions Post Conditions normally Normal flow of events Alternative flow of events Exceptional flow of events Implementation issues
meaningful name of the UC the author and creation date last modification and its date specifies the goal to be achieved short description of the processes requirements references agents participating must be true to allow execution will be set when completes regular flow of activities other flow of activities unusual situations foreseen implementation problems
Use Case: Withdraw Money Author: ZB Date: 1-OCT-2004 Purpose: To withdraw some cash from users bank account Overview: The use case starts when the customer inserts his credit card into the system. The system requests the user PIN. The system validates the PIN. If the validation succeeded, the customer can choose the withdraw operation else alternative 1 validation failure is executed. The customer enters the amount of cash to withdraw. The system checks the amount of cash in the user account, its credit limit. If the withdraw amount in the range between the current amount + credit limit the system dispense the cash and prints a withdraw receipt, else alternative 2 amount exceeded is executed.
The ATM must be in a state ready to accept transactions The ATM must have at least some cash on hand that it can dispense The ATM must have enough paper to print a receipt for at least one transaction The current amount of cash in the user account is the amount before the withdraw minus the withdraw amount A receipt was printed on the withdraw amount The withdraw transaction was audit in the System log file
Post Condition:
2. Customer inserts a Credit card into ATM 3. System verifies the customer ID and status 4. System asks for an operation type 5. Customer chooses Withdraw operation 6. System asks for the withdraw amount 7. Customer enters the cash amount 8. System checks if withdraw amount is legal 9. System dispenses the cash 10. System deduces the withdraw amount from account 11. System prints a receipt 12. System ejects the cash card 13. Customer takes the cash and the receipt
Step 3: Customer authorization failed. Display an error message, cancel the transaction and eject the card. Step 8: Customer has insufficient funds in its account. Display an error message, and go to step 6. Step 8: Customer exceeds its legal amount. Display an error message, and go to step 6. Power failure in the process of the transaction before step 9, cancel the transaction and eject the card
Use Case 1: Buy a product Primary actor: buyer/customer Goal: purchase some product Precondition: Customer is already logged in
Requirements
86
1. 2. 3.
Main Scenario
Customer browses and selects items Customer goes to checkout Customer fills shipping options System presents full pricing info Customer fills credit card info System authorizes purchase System confirms sale System sends confirming email
Requirements 87
4.
5. 6. 7. 8.
Alternatives
Allows customer to reenter info System displays last 4 digits of credit card no Asks customer to OK it or change it Moves to step 6
Requirements
88
0 1 2 3
: : : :
Auction an item Put an item for auction Make a bid Complete auction of an item
Use Case 0 : Auction an item Primary Actor: Auction system Scope: Auction conducting organization Precondition: None Main Success Scenario:
Seller performs put an item for auction Various bidders make a bid On final date perform Complete the auction of the item Get feed back from seller; get feedback from buyer; update records
Requirements 90
1.
Use Case1: Put an item for auction Primary Actor: Seller Precondition: Seller has logged in Main Success Scenario:
2. 3.
4.
Exception Scenarios:
Seller posts an item (its category, description, picture, etc.) for auction System shows past prices of similar items to seller System specifies the starting bid price and a date when auction will close System accepts the item and posts it * System tells the seller this situation
Requirements
91
1. 2.
Use Case2: Make a bid Primary Actor: Buyer Precondition: The buyer has logged in Main Success Scenario:
Buyer searches or browses and selects some item System shows the rating of the seller, the starting bid, the current bids, and the highest bid; asks buyer to make a bid Buyer specifies bid price, max bid price, and increment Systems accepts the bid; Blocks funds in bidders account System updates the bid price of other bidders where needed, and updates the records for the item
3. 4. 5.
Requirements
92
Exception Scenarios:
-- 3 a) The bid price is lower than the current highest * System informs the bidder and asks to re-bid -- 4 a) The bidder does not have enough funds in his account * System cancels the bid, asks the user to get more funds
Requirements 93
Use Case3: Complete auction of an item Primary Actor: Auction System Precondition: The last date for bidding has been
reached
Select highest bidder; send email to selected bidder and seller informing final bid price; send email to other bidders also Debit bidders account and credit sellers account Transfer from sellers account commission amount to organizations account Remove item from the site; update records
UCs specify functional requirements Other req identified separately A complete SRS will contain the use cases plus the other requirements
UCs form a good medium for brainstorming and discussions Hence can be used in elicitation and problem analysis also UCs can be developed in a stepwise refinement manner
Developing
Prepare an actor-goal list Provide a brief overview of the UC This defines the scope of the system Completeness can also be evaluated
For each UC, expand main scenario This will provide the normal behavior of the system Can be reviewed to ensure that interests of all stakeholders and actors is met
Requirements 97
Developing
List possible failure conditions for UCs For each step, identify how it may fail This step uncovers special situations Perhaps the hardest part Specify system behavior for the failure conditions New business rules and actors may emerge
Requirements
98
Requirements Validation
Lot of room for misunderstanding Errors possible Expensive to fix req defects later Must try to remove most errors in SRS Most common errors
Requirements Review
SRS reviewed by a group of people Group: author, client, user, dev team rep. Must include client and a user Process standard inspection process Effectiveness - can catch 40-80% of req. errors Checklists frequently used in reviews.
Requirements
100
Summary
Having a good quality SRS is essential for Q&P The req. phase has 3 major sub phases
analysis , specification and validation for problem understanding and modeling Methods used: SSAD, OOA , Prototyping
Analysis
Summary..
Specification
must contain functionality , performance , interfaces and design constraints Mostly natural languages used
Use Cases is a method to specify the functionality; also useful for analysis Validation - through reviews
Requirements 102