f22 Sre Lecture 8
f22 Sre Lecture 8
Requirements Engineering
Lecture 8
Introduction to Requirements Analysis and Specification
Today’s Agenda
Introduction to Requirements Analysis
Structuring Requirements
Modeling
4
Questions
Wehave seen how to specify requirements in terms of structure, standards,
and writing rules, but:
How to identify the real problems to solve in the elicitation results?
How to detect conflicting aspects?
How to negotiate to resolve conflicts?
How to decide what is important and a priority?
How to ensure that nothing is forgotten?
How to validate that the findings of the analysis are good?
How to use models in this context?
5
How to Find the Real Problems?
Ask: Why?
Root cause analysis
Determine (recursively) the factors that contribute to the problem(s) found by stakeholders
The causes do not all have the same impact nor the same weight
Some may perhaps not deserve to be corrected, at least for the moment
Goal-oriented modeling can help understand these causes and their relationships
6
What is Requirements Specification?
The
invention and definition of the behavior of a new system (solution
domain) such that it will produce the required effects in the problem
domain
Start
from a knowledge of the problem domain and the required effects
determined by elicitation and analysis Specification
description of Solution
Generally involves modeling System needed to
problem solution satisfy Problem Domain
interface
Results in the specification
domain documentsystem
Hardware
Domain
Precise expression of requirements, may include models
Software
properties
Requirements
7
Requirements Analysis
Problem analysis
Development of product vision and project scope
Analysis and elicitation feed each other
Elicitation
Elicitation Questions and points
Notes to consider
Analysis
Requirements Specification
8
Requirements Modeling
Elicitation/analysis and modeling are intermixed
Source: http://www.telelogic.com/download/paper/SystemsEngineeringSandwich.pdf
9
Requirements Modeling
This is an essential task in specifying requirements
Map elements obtained by elicitation to a more precise form
Help better understand the problem
Help find what is missing or needs further discussion
10
Requirements Verification and Validation
Need to be performed at every stage during the (requirements) process
Elicitation
Checking back with the elicitation sources
“So, are you saying that . . . . . ?”
Analysis
Checking that the domain description and requirements are correct
Specification
Checking that the defined system requirement will meet the user requirements under the
assumptions of the domain/environment
Checking conformity to well-formedness rules, standards…
11
Requirements Classification
Inorder to better understand and manage the large number of requirements, it is important to
organize them in logical clusters
It
is possible to classify the requirements by the following categories (or any other clustering that
appears to be convenient)
Features
Use cases
Mode of operation
User class
Responsible subsystem
12
Requirements Classification – Features
A Feature is
a set of logically related (functional) requirements that provides a capability to the user
and enables the satisfaction of a business objective
15
Modeling Notations
Natural language (English) Semi-formal notation (URN, UML...)
Syntax (graphics) well defined
No special training required
Partial common understanding, reasonably easy to
Ambiguous, verbose, vague, obscure ...
learn
No automation Partial automation
Meaning only defined informally
Ad hoc notation (bubbles and arrows)
Still a risk of ambiguities
No special training required
Formalnotation (Logic, SDL, Petri nets,
No syntax formally defined
FSM ...)
meaning not clear, ambiguous Syntax & semantics defined
No automation Great automation (analysis and transformations)
More difficult to learn & understand
16
Modeling notations (2)
Informallanguage is better
understood by all stakeholders
Good for user requirements, contract
But, language lacks precision
Possibility for ambiguities
Lack of tool support
18
Modeling inputs and outputs
Nature of inputs and outputs:
IO related to problem (problem data)
Additional data related to solution (solution data)
E.g., prompts, user options, error messages…
Collected in Data Dictionary using
Plain text (natural language)
EBNF
Code-like notations
Logic (e.g., VDM)
Structure charts
…
19
Modeling Dynamic Behavior
Behavior modeling techniques
Text (plain, function statements, use cases)
Decision tables
Activity Diagrams / Use Case Maps
Finite state machines
Simple state machines (FSM) : use state diagrams or transition table notation
Extended state machines (e.g. UML State Machines – including SDL)
Harel’s State Charts (concepts included in UML notation)
Petri nets (allows for flexible concurrency, e.g. for data flow, similar to Activitity Diagrams)
Logic (e.g. Z, VDM) for describing input-output assertions and possibly relationship to internal object state
that is updated by operations)
It is important to chose what best suits the problem
20
Model Analysis
By construction
We learn by questioning and describing the system
By inspection
Execute/analyze the model in our minds
Reliable?
By formal analysis
Requires formal semantics (mathematical) and tools
Reliable (in theory), but expensive (for certain modeling approaches)
By testing
Execution, simulation, animation, test...
Requires well-defined semantics and execution/simulation tools
More reliable than inspection for certain aspects
Possible to interact directly with the model (prototype)
21
Typical Modeling Approaches
Many approaches involve modeling to get a global picture of the requirements
Structured Analysis (1970)
Object-Oriented Analysis (1990)
Problem Frames (1995)
State Machine-Based Analysis
Conflict Analysis
E.g. with mis-use cases or with GRL/UCM models and strategies/scenarios
It is important to distinguish between
Notation used for defining the model
Process defining a sequence of activities leading to a desired model
22
Requirements Specification Document (1)
Clearlyand accurately describes each of the essential requirements (functions, performance,
design constraints, and quality attributes) of the system / software and its external interfaces
Defines the scope and boundaries of the system / software
Each requirement must be described in such a way that it is feasible and objectively verifiable by
a prescribed method (e.g., by inspection, demonstration, analysis, or test)
23
Requirements Specification Document (2)
Specifications are intended to a diverse audience
Customers and users for validation, contract, ...
Systems (requirements) analysts
Developers, programmers to implement the system
Testers to check that the requirements have been met
Project Managers to measure and control the project
24
Example Specification (1) lamp
Appearance
12 cm
switch
lever
When the switch lever is moved down, then, within 0.1 seconds, the lamp illuminates.
When the switch lever is moved up, then, within 0.2 seconds, the lamp goes out.
28
IEEE 830-1998 Standard – Benefits
Establishthe basis for agreement between the customers and the suppliers on what the software
product is to do
29
IEEE 830-1998 Standard – Considerations
Section 4 of IEEE 830 (how to produce a good SRS)
Nature (goals) of SRS
Functionality, interfaces, performance, qualities, design constraints
Environment of the SRS
Where does it fit in the overall project hierarchy
Characteristics of a good SRS
Generalization of the characteristics of good requirements to the document
Evolution of the SRS
Implies a change management process
Prototyping
Helps elicit software requirements and reach closure on the SRS
Including design and project requirements in the SRS
Focus on external behavior and the product, not the design and the production process (describe in a separate document)
30
IEEE 830-1998 Standard – Structure of the
SRS
Section 5 of IEEE 830
Contents of SRS
Introduction
General description of the software product
Specific requirements (detailed)
Additional information such as appendixes and index, if necessary
31
IEEE 830-1998 Standard – Section 1 of SRS •Describe purpose of this SRS
•Describe intended audience
Index
IEEE 830-1998 Standard – Section 2 of SRS•Present the business case and operational concept of the system
•Describe how the proposed system fits into the business context
•Describe external interfaces: system, user, hardware, software, communication
•Describe constraints: memory, operational, site adaptation
36
Relationship of IEEE 830 and ISO/IEC
12207 (1)
12207
Common framework for « Software life cycle processes »
ISO/IEC 12207 = IEEE/EIA 12207
37
Relationship of IEEE 830 and ISO/IEC
12207 (1)
Note: Table
B.3 is more detailed and shows the correspondence between the two standards at the level of
requirements types
38
Writing Better Requirements
DRAFT
The greatest challenge to any thinker is stating the problem
in a way that will allow a solution.1
[1] Bertrand Russell, 1872-1970
41
Identifies the system under discussion and a desired end result that is wanted within a specified time that is measurable
The challenge is to seek out the system under discussion, end result, and success measure in every requirement
42
The whole requirement provides the specifics of a desired end goal or result
Contains a success criterion or other measurable indication of the quality
44
A Few Simple
The Tests…(2)
software shall be reliable. X
“Negation” test
If the negation of a requirement represents a position that someone might argue for, then the original
decision is likely to be meaningful
The car shall have an engine. X
“Find the test” test
The requirement is problematic if no test can be found or the requirement can be tested with a test that
does not make sense
Test: look, here it is!
Source: Spencer Smith, McMaster U.
53
Rate these Requirements
The Order Entry system provides for quick, user- X
friendly and efficient entry and processing of all orders.
Complete (satisfiable)
Specifies all the things the system Uses all terms consistently
must do (including contingencies) Note: inconsistency can be hard to
...and all the things it must not do! detect, especially in concurrency/timing
aspects and condition logic
Conceptual Completeness
Formal modeling can help
(e.g., responses to all classes of input)
Structural Completeness Beneficial
(e.g., no TBDs!!!) Has benefits that outweigh the costs of
development
• Feasible
• Needed
• Testable
Measures and Metrics
59
Non-Functional Requirements
Non-Functional Requirements and Software Quality Attributes
Software Quality
Classifications of Non-Functional Requirements
Quality Measures
To measure is to know. If you can not measure it, you can not improve it. 1
[1] Lord Kelvin (1824 - 1907)
60
Implication:
We need to be able to explicitly quantify requirements and verify that any solution meets them
We need measures
Therefore, unless you have unrealistic values, requirements are usually met
Important to know what measures exist!
The chosen values, however, will have an impact on the amount of work during
development as well as the number of alternatives and architectural designs from which
developers may choose to meet the requirements
62
Quantification
Non-functional requirements need to be measurable
Avoid subjective characterization: good, optimal, better...
Precise numbers are unlikely to be known at the beginning of the requirement process
Do not slow down your initial elicitation process
Ensure that quality attributes are identified
Negotiate precise values later during the process
63
Some Relationships
collection of qualities
Quality (WHAT?)
HOW?
Measurement: The mean time to failure and mean time to repair of critical components must be identified (typically measured) or estimated
Modeling reliability and availability: e.g. Markov models
70
Availability Downtime
90% 36.5 days/year
99% 3.65 days/year
99.9% 8.76 hours/year
99.99% 52 minutes/year
99.999% 5 minutes/year
99.9999% 31 seconds/year
71
Examples of requirements
The application shall identify all of its client applications before allowing them to use its
capabilities.
The application shall ensure that the name of the employee in the official human resource and
payroll databases exactly matches the name printed on the employee’s social security card.
At least 99% of intrusions shall be detected within 10 seconds.
73
Memorability
Number (or ratio) of learned tasks that can still be performed after not using the system for a given time
period
Error avoidance
Number of error per time period and user class
Number of calls to user support
74
Examples
Four out of five users shall be able to book a guest within 5 minutes after a 2-hour
introduction to the system.
Novice users shall perform tasks X and Y in 15 minutes.
Experienced users shall perform tasks X and Y in 2 minutes.
At least 80% of customers polled after a 3 months usage period shall rate their
satisfaction with the system at 7 and more on a scale of 1 to 10.
75
Measurement tools
code analysis tools such as IBM Structural Analysis for Java
(http://www.alphaworks.ibm.com/tech/sa4j)
76
Testability Measures
Measures the ability to detect, isolate, and fix defects
Time to run tests
Time to setup testing environment (development and execution)
Probability of visible failure in presence of a defect
Test coverage (requirements coverage, code coverage…)
Examples
The delivered system shall include unit tests that ensure 100% branch coverage.
Development must use regression tests allowing for full retesting in 12 hours.
78
Portability Measures
Measure ability of the system to run under different computing environments
Hardware, software, OS, languages, versions, combination of these
Can be measured as
Number of targeted platforms (hardware, OS…)
Proportion of platform specific components or functionality
Mean time to port to a different platform
Examples
No more than 5% of the system implementation shall be specific to the operating system.
The meantime needed to replace the current Relational Database System with another
Relational Database System shall not exceed 2 hours. No data loss should ensue.
79
Reusability
Measures ability that existing components can be reused in new applications
Can be expressed as
Percentage of reused requirements, design elements, code, tests…
Coupling of components
Degree of use of frameworks
80
Robustness Measures
Measure ability to cope with the unexpected
Percentage of failures on invalid inputs
Degree of service degradation
Minimum performance under extreme loads
Active services in presence of faults
Length of time for which system is required to manage stress conditions
Examples
The estimated loss of data in case of a disk crash shall be less than 0.01%.
The system shall be able to handle up to 10000 concurrent users when satisfying all
their requirements and up to 25000 concurrent users with browsing capabilities.
81
Domain-specific Measures
The most appropriate quality measures may vary from one application domain to another, e.g.:
Performance
Web-based system:
Number of requests processed per second
Video games:
Number of 3D images per second
Accessibility
Web-based system:
Compliance with standards for the blind
Video games:
Compliance with age/content ratings systems (e.g., no violence)
82