Академический Документы
Профессиональный Документы
Культура Документы
Requirements Engineering
fundamentals
2
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
3
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
“precise specification”
• Provide the basis for
– Analyzing the requirements
– Validating that these requirements are what stakeholders want
– Defining what the designers have to build
– Verifying that the designers have built the right system
4
SWENG 580: Advanced Software Engineering
families”
• Emphasizes the reality of
– A changing world
– The need to reuse partial specifications
5
SWENG 580: Advanced Software Engineering
Core RE activities
© Engineering Division, The Pennsylvania State University
6
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
7
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Philosophy
• Epistemology – understanding beliefs of stakeholders
• Phenomenology – what is observable in the world
• Ontology – what can be agreed on as objectively true
8
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Cognitive psychology
• Provides an understanding
of the difficulties people
may have in describing
their needs.
• Domain experts utilize
subconscious knowledge
that they cannot articulate
leading to a mismatch
between their response to
questions and their actual
behavior.
9
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Anthropology
• Observing human activities helps in understanding how computer systems
may help or hinder those activities.
– Ethnomethodology has been used to develop observational techniques for analyzing team-
working (also termed ethnography)
10
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Sociology
• Understanding the political and cultural changes caused by technology.
• Introduction of a computer system can change many things:
– An organizations way of working
– An organizations structure
– Communication paths
– Even the original needs that it was built to satisfy
• Must ensure the process doesn’t become politicized possibly by involving
those most affected by the system
11
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Linguistics
• RE is about communication.
• Ambiguity and misunderstanding is easy when natural language is used to
express requirements.
12
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
What is a requirement?
• Can range from a high-level, abstract statement of a service or constraint to
a detailed, formal specification.
• Why?
– Requirements may be basis for a bid so must be open to interpretation.
– Requirements may be part of the contract itself so must be defined in detail.
13
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Requirement abstraction
• “If a company wishes to let a contract for a large software development
project, it must define its needs in a sufficiently abstract way that a solution
is not pre-defined. The requirements must be written so that several
contractors can bid for the contract, offering, perhaps, different ways of
meeting the client organization's needs. Once a contract has been awarded,
the contractor must write a system definition for the client in more detail so
that the client understands and can validate what the software will do. Both
of these documents may be called the requirements document for the
system.” (Davis, 1993)
14
SWENG 580: Advanced Software Engineering
solution
• A separate problem
description is
useful as it can
serve as a basis for
discussion with
stakeholders to see
if it corresponds to
their needs,
evaluating design
choices and
generating test
cases
16
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Requirements classification
• To cope with this duality we can classify requirements in terms of their
level of abstraction.
• Sommerville (2005) suggests:
– User requirements
– System requirements
– Software design specifications
17
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
User requirements
• Abstract statements written in natural language with accompanying
informal diagrams.
• Specify what services (user functionality) the system is expected to provide
and any constraints.
18
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
System requirements
• Detailed descriptions of the services and constraints.
• Should be structured and precise.
• Acts as contract between client and contractor.
• Sometimes referred to as functional specification or technical annex.
• Derived from analysis of the user requirements.
19
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
20
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Example
• User requirement
1. The software must allow a user to access, and subsequently bet on
individual sporting events
• System Requirement
1.1 The user should be presented with the available sporting events
1.2 Facilities should be provided to allow the user to search the available events
based upon the sport, the date/time or by competitor.
1.3 The software should allow users to select one or more events from the
selection.
1.4 The selected events should be presented along with the current odds
for each event and outcome.
1.5 The software should allow the user to place a bet on any of those
events in the selection.
1.6 The software should record that bet, updating the users account.
21
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Another classification
• Functional requirements
• Non-functional requirements
• Domain requirements
22
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Functional requirements
• The services the system should provide.
• How it will react to inputs.
• Sometimes state what the system should not do.
• Can be high-level and general (user requirements) or detailed, expressing
inputs, outputs, exceptions, etc. (system requirements)
23
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Non-functional requirements
• Requirement imposed by the environment in which the system is to exist.
• This could mean timing constraints, quality properties, standard adherence,
programming languages to be used…
24
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Non-functional
requirements
Portability
Efficiency Reliability Interoperability Ethical
requirements
requirements requirements requirements requirements
25
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Experienced operators shall be able to use all the system functions after 2
hours of training
26
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Domain requirements
• Derived from the application domain.
• May be:
– New functional requirements.
– Constraints on existing functional requirements.
– Specify how particular computations must be performed.
27
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
28
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Eh!
• The example highlights an important issue with domain requirements.
• They are often expressed by domain experts using domain-specific
terminology.
• They are used by software engineers unfamiliar with the intricacies of the
domain.
• Additionally, domain experts often leave out information from a
requirement as they understand the area so well.
29
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
User requirements
• Describe functional and non-functional requirements as they pertain to
externally visible behavior in a form understandable by clients and/or
system users.
• Use natural language, tables and simple intuitive diagrams.
30
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
31
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
32
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
33
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
34
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
2.6.1 The editor shall provide a grid facility where a matrix of horizontal
and vertical lines provide a background to the editor window. This
grid shall be a passive grid where the alignment of entities is the user's
responsibility.
Rationale: A grid helps the user to create a tidy diagram with well-spaced
entities. Although an active grid, where entities 'snap-to' grid lines can be
useful, the positioning is imprecise. The user is the best person to decide
where entities should be positioned.
35
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Rationale: The user is the best person to decide where to position a node on
the diagram. This approach gives the user direct control over node type
selection and positioning.
36
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
System requirements
• More detailed specifications of user requirements
• Serve as a basis for designing the system
• May be used as part of the system contract
• System requirements may be expressed using system models (first iteration
of analysis models)
37
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
38
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Notation Description
Structured This approach depends on defining standard forms or
natural templates to express the requirements specification.
language
Design This approach uses a language like a programming language
description but with more abstract features to specify the requirements by
languages defining an operational model of the system.
Graphical A graphical language, supplemented by text annotations is
notations used to define the functional requirements for the system. An
early example of such a graphical language was SADT
(Schoman and Ross, 1977). More recently, use-case
descriptions (Jacobsen, Christerson et al., 1993) have been
used.
Mathematical These are notations based on mathematical concepts such as
specifications finite-state machines or sets. These unambiguous
specifications reduce the arguments between customer and
contractor about system functionality. However, most
customers don’t understand formal specifications and are
reluctant to accept it as a system contract.
39
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
40
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Form-based specification
• Include the following information:
1. Definition of the function or entity
2. Description of inputs and where they come from
3. Description of outputs and where they go to
4. Indication of other entities required
5. Pre- and post-conditions (if appropriate)
6. The side effects (if any)
41
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
42
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
43
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
class ATM {
// declarations here
public static void main (String args[]) throws InvalidCard {
try {
thisCard.read () ; // may throw InvalidCard exception
pin = KeyPad.readPin () ; attempts = 1 ;
while ( !thisCard.pin.equals (pin) & attempts < 4 )
{ pin = KeyPad.readPin () ; attempts = attempts + 1 ;
}
if (!thisCard.pin.equals (pin))
throw new InvalidCard ("Bad PIN");
thisBalance = thisCard.getBalance () ;
do { Screen.prompt (" Please select a service ") ;
service = Screen.touchKey () ;
switch (service) {
case Services.withdrawalWithReceipt:
receiptRequired = true ;
44
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Interface specification
• Most systems must operate with other systems and the operating interfaces
must be specified as part of the requirements
• Three types of interface may have to be defined
– Procedural interfaces
– Data structures that are exchanged
– Data representations
• Formal notations are an effective technique for interface specification
45
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
46
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
47
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Use
Usethe
therequirements
requirementsdocument
documenttotoplan
planaa
Managers
Managers bid
bidfor
forthe
thesystem
systemand
andtotoplan
planthe
thesystem
system
development
developmentprocess
process
Use
Usethe
therequirements
requirementstotounderstand
understandwhat
what
Developers
Developers system is to be developed
system is to be developed
Use
Usethe
therequirements
requirementstotodevelop
developvalidation
validation
Test
Testengineers
engineers tests
testsfor
forthe
thesystem
system
Use
Usethe
therequirements
requirementstotohelp
helpunderstand
understand
Maintenance
Maintenanceengineers
engineers the
the system and the relationshipbetween
system and the relationship betweenits
its
parts
parts
48
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
49
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
Key points
• Requirements set out what the system should do and define constraints on
its operation and implementation
• Functional requirements set out services the system should provide
• Non-functional requirements constrain the system being developed or the
development process
• User requirements are high-level statements of what the system should do
• User requirements should be written in natural language, tables and
diagrams
• System requirements are intended to communicate the functions that the
system should provide
• System requirements may be written in structured natural language, a PDL
or in a formal language
• A software requirements document is an agreed statement of the system
requirements
50
© Engineering Division, The Pennsylvania State University SWENG 580: Advanced Software Engineering
References
• A. Davis, Software Requirements: Objects, Functions and States, Second
Edition, Upper Saddle River, NJ: Prentice-Hall, 1993.
• B. Nuseibeh and S. Easterbrook,“Requirements Engineering: A Roadmap”,
Proceedings of the International Conference on Software Engineering,
Limerick, Ireland, June 2000, pp. 35 – 46.
• I. Sommerville, Software Engineering, 7th ed., Boston, MA: Addison-
Wesley, 2005.
• P. Zave, “Classification of Research Efforts in Requirements Engineering,”
ACM Computing Surveys, 29(4), pp 315 – 321.
51