Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 47

Writing Requirements

1
Different Kinds of Requirements

2
What are Requirements?
“Requirements are … a specification of what should be implemented. They are
descriptions of how the system should behave, or of a system property or
attribute. They may also include constraints on the development process of the
system.”
• Requirements drive every thing downstream in the project.
• If you get the requirements wrong – your system is doomed
• Good requirements analysis also helps prevent “Scope Creep”

[Sommerville and Sawyer, 1997]

3 3
Scope Creep
• The uncontrolled changes or continuous growth in a project's scope. This can
occur when the scope of a project is not properly defined, documented, or
controlled.

Manager
Business Requirements
• Business requirements capture the business need and rationale for the
proposed project.
• Business requirements tells us why -- at the business level -- we’re doing
the project.
• They should state, or at least contain implicitly, the benefits the sponsoring
business organization expects to derive from a successful project.

Example: The new InvestNow equity management system will better serve
our low-end equity investors (those with portfolios under $50K) by allowing
them to manage their own equity portfolios online. This self-service system
will provide more timely service to these investors and also save the
company money through the reduction of staff currently required to
manage these accounts.

5 5
User Requirements
• User requirements capture what the user will be able to do and
accomplish with the finished product.
• These requirements are defined by the goals and tasks that the users must
be able to perform using the product.
• User requirements are driven by the business requirements. In other
words, if the user requirements are satisfied, this should ensure the
attainment of the business requirements.

Example: Users of the InvestNow equity management system will be able


to 1) view their portfolio, 2) manage their account profile, 3) receive on-
screen information about companies they currently invest in, 4) receive on-
screen information about companies they are considering making
investments in, and 5) buy and sell shares of stock within the limits set by
their account profile.

6
Functional Requirements
• Functional requirements describe what the developer is supposed to build.
• Functional requirements specify what the system will do or what it will allow
the user to do.
• These requirements are driven by the business and user requirements, but
they go a step further by describing what the system will do to satisfy those
higher-level requirements.

Example: The system will allow the user to request to view his or her account
profile. Upon this request, the system will display the current profile. The
user will then be allowed to edit any user-editable fields in the profile. The
edited profile will then be presented to the user for approval before the
changes are actually made to the stored profile.

etc. …

7 7
Quality Attributes
• Quality attributes describe the product’s characteristics in ways that are
important to users, developers, or those who will maintain the system.
• Such characteristics might involve availability, performance, usability,
robustness, reliability, and similar attributes.
• Quality attributes should be stated precisely and succinctly and where
possible they should be quantified.

Examples:
For user editing of account profiles, drop-down menus, radio buttons and
similar methods should be used where possible to make editing more
convenient and to reduce user input errors.

A user request to view his or her portfolio summary should be satisfied in less
than 5 seconds.
8 8
External Interfaces
• Interfaces between the proposed system and other existing systems (hardware
or software) or the external world should be specified.
• When human user interfaces are a part of the proposed system, these should
be specified where possible using prototypes that have been approved by the
appropriate human user representatives.

Examples:
All account profile information will continue to reside within the existing
SI_Accounts DB2 database.

All requests from users for investment company information will be satisfied by
accessing the Investor_Inform service to which the company subscribes.

The basic forms of the graphical user interfaces for the system are specified in
Prototype IN101v4.
9 9
Design and Implementation Constraints
• Design and implementation constraints are restrictions imposed on the
proposed system for some legitimate reason.
• These constraints might include technical features, tools to be used, languages
to be used, development standards, and so on.

Examples:
To access the SI_Accounts database, the system will utilize the existing DB2
access modules: IN_ACC#233v1 and OUT_ACC#765v8.

Any changes to the SI_Accounts database must be approved by the DBA and the
Chief Design Architect.

All coding for the InvestNow system will be done in the Java programming
language unless explicit permission to do otherwise is obtained from the Chief
Design Architect.
10 10
Goals, Objectives and Requirements
• A project comes into existence to do something: to have the end result - effect some
change. This is nearly always expressed in the language of the sponsor's business.
For example, the result of a web development project might be to increase sales or
to implement customer self-service. We call these Project Goals, and meeting these
goals is the primary focus of the project sponsor. Project goals capture the intended
fulfillment of a stated business need.
• The project exists to produce accomplishments that do fulfill the stated goals. These
accomplishments, which should be measurable, we typically call Project Objectives.
These are the things that the project directly produces: an eCommerce site; a web-
enabled self-service application, etc. Accomplishing the project objectives should
ensure that the project fulfills the stated goals.
• So what are Requirements? Requirements are the necessary specific outcomes that
are required to realize the objectives - and that the project therefore must deliver.
• To put it another way, requirements are the detailed view of the project objectives.
Because requirements are the things that the project must deliver, they are the
absolute definition of whether the project has achieved its objectives (and thus
fulfilled its goals).

Adapted from Introducing Project Requirements, by Martin Burns, www.evolt.org. 11 11


Project Objectives
• Project objectives are generally created at a higher level than the actual
project business requirements.
• Objectives are usually written first, and then refined into the actual
business requirements.
• Objectives are then in a sense just high-level requirements, and thus they
must be constructed with the same care and attention to detail as the
business requirements themselves.
• The main difference is that the business requirements, being much more
detailed, will require even closer and more careful scrutiny at a detailed
level than objectives.
• The following modified diagram captures this relationship between
objectives and requirements.

12 12
Characteristics of Good Requirements

13
The Requirements Analysis Process
Reviewed The Foundation for
the Entire Project
Problem

Business
Fuzzy Requirements
Ambiguous
Ill-defined System
Problem Defined Requirements
Unstable
Solution Envisioned
Business Outcomes
Articulated Rigorous
Precise
Unambiguous
Foundation for Design

14
Setting the Right Foundation
• Many software requirements documents are filled with
badly written requirements.
• Because the quality of any product depends on the quality
of the raw materials fed into it, poorly written
requirements are unlikely to lead to excellent software.

15
What Makes a Good Requirement?
• How can we distinguish a good requirement from those that
have problems?
• Wiegers and others have identified five basic characteristics
individual requirement statements should exhibit.
• Each requirement should be:
• Correct
• Feasible
• Necessary
• Unambiguous
• Verifiable (Testable)

Much of the material in this material is adapted from the


article Writing Quality Requirements by Karl Wiegers
published in Software Development, May 1999.

16
Each Requirement Should Be Correct
• Each requirement must accurately describe the functionality
to be delivered.
• The checkpoint for correctness is the source of the
requirement -- the actual customer.
• Only the customers can determine the correctness of
functional requirements, which is why it is essential to
include them in the development of the requirements.
• Requirements inspections that do not involve customers can
lead to developers saying, "That doesn’t make sense. This is
probably what they meant.“ Not a good outcome.
Each Requirement Should Be Feasible
• It must be possible to implement each requirement within
the known capabilities and limitations of the system and its
environment.
• To avoid infeasible requirements, someone knowledgeable
about the system capabilities should work with the
requirements analysts in the requirements development
process.
• Such a person can provide a reality check on what can and
cannot be done technically, as well as to what can be done
only at excessive cost or other tradeoffs.

18
Each Requirement Should Be Necessary
• Each requirement should document something the
customers really need or something that is required for
conformance to an external requirement, an external
interface, or a standard.
• Another way to think of "necessary" is that each
requirement originated from a source you recognize as
having the authority to specify requirements.
• If you cannot identify the origin and verify the authority
behind the requirement, it may be an example of
unnecessary "gold plating".

19
Each Requirement Should Be Unambiguous
• The reader of a requirement should be able to draw only one
interpretation from it.
• In addition, multiple readers of a requirement should arrive at
the same interpretation.
• Natural languages like English are highly prone to ambiguity.
• To help avoid ambiguity, we should avoid subjective words like
user-friendly, easy, simple, fast, efficient, several, state-of-the-
art, world-class, improved, maximized, and minimized.
• We should strive to write each requirement in succinct, simple,
straightforward language of the customer domain, not in
computerese.

20
Each Requirement Should Be Verifiable/Testable
• For each requirement you should be able to devise tests or use
other verification approaches, such as inspection or
demonstration, that will clearly determine whether or not
each requirement is properly implemented in the product.
• If a requirement is not verifiable, determining whether it was
correctly implemented will become a matter of opinion and no
doubt contention, leading to an unhappy implementation.

21
What Makes a Good Requirements
Document?
• On the previous slides we identified five characteristics that each
individual requirement should have.
• There are also characteristics that the set of requirements (captured
in the requirements document) should possess.
• A Requirements Document should be:
• Complete
• Consistent
• Modifiable
• Traceable

22
A Requirements Document Should Be Complete
• No requirements or necessary information should be missing.
• Note that it is hard to spot missing requirements because they aren’t there.
• To help with this it is very important to organize the requirements
hierarchically to help reviewers of the requirements document understand
the structure of the functionality described, so it will be easier for them to
tell if something is missing.
• If you focus on user tasks rather than on system functions during
requirements development, you are less likely both to overlook
requirements and to include unnecessary requirements.
• The Use Case method (later in the course) works well for this purpose.
• If you know you are lacking certain information, use "TBD" ("to be
determined") as a standard flag to highlight such gaps. All TBDs should be
resolved before you proceed with construction of the relevant part of the
product.

23
A Requirements Document Should Be Consistent
• A consistent requirements document contains a set of requirements
that do not conflict with one another or other software requirements.
• Disagreements among requirements must be resolved before
development can proceed.
• When you find inconsistent requirements, you may not know which (if
any) is correct until you do some research.
• Caution: Be very careful when modifying the requirements document,
because inconsistencies can slip in undetected if you review only the
specific change and not any related requirements (the equivalent of
regression testing for system changes).

24
A Requirements Document Should Be Modifiable
• As we will see shortly, change in requirements documents is
inevitable.
• Thus, you must be able to revise the requirements document when
necessary and maintain a history of changes made to each
requirement.
• This means that each requirement must be uniquely labeled and
expressed separately from other requirements so you can refer to it
unambiguously.
• You can make a requirements document more modifiable by
organizing it so that related requirements are grouped together, and
by creating a table of contents, index, and cross-reference listing.

25
A Requirements Document Should Be Traceable
• Each requirement in the requirements document should be linkable
(traceable) to its source.
• Each requirement should also be linked to the design elements,
source code, and test cases that are constructed to implement and
verify the requirement as the project progresses.
• Traceable requirements must be uniquely labeled and written in a
detailed and structured way, as opposed to large, narrative paragraphs
or bullet lists.

26
Requirements Writing Tips

27
Some Requirements Writing Guidelines
• Write complete sentences.
• Keep sentences and paragraphs short.
• Use the active voice.
• Use proper grammar, spelling, and punctuation.
• Use terms consistently and define them in a glossary or
data dictionary.
Some Requirements Writing Guidelines (cont’d)
• To see if a requirement statement is sufficiently well
defined, read it from the test designer’s and system
analyst’s perspective.
• Ask if you need additional clarification from the
requirements author to understand the requirement well
enough to test it?
• If so, that requirement should be elaborated before
proceeding.

29
Some Requirements Writing Guidelines (cont’d)
• Requirement authors often struggle to find the right level of
granularity. Avoid long narrative paragraphs that contain
multiple requirements.
• A helpful granularity guideline is to write individually
testable requirements. If you can think of a small number of
related tests to verify correct implementation of a
requirement, it is probably written at the right level of
detail.
• If you envision many different kinds of tests, perhaps several
requirements have been lumped together and should be
separated.

30
Some Requirements Writing Guidelines (cont’d)
• Watch out for multiple requirements that have been
aggregated into a single statement.
• Conjunctions like "and" and "or" in a requirement suggest
that several requirements have been combined.
• Never use "and/or" in a requirement statement. In other
words, “A and/or B” should be replaced with “A or B, or
both”.

31
Some Requirements Writing Guidelines (cont’d)
• Write requirements at a consistent level of detail throughout
the document. Here’s an example of such inconsistency.
Suppose these two requirements were found in the same
requirements document.
• "A valid color code shall be R for red" and "A valid color
code shall be G for green" have been split out as
separate requirements (VERY DETAILED)
• While in the same document you find: "The product
shall respond to editing directives entered by voice"
meant to describe an entire subsystem, not a single
functional requirement. (VERY HIGH-LEVEL)

32
Some Requirements Writing Guidelines (cont’d)
• Avoid stating requirements redundantly in the requirements
document.
• While including the same requirement in multiple places
may make the document easier to read, it also makes
maintenance of the document a nightmare.
• The multiple instances of the requirement all have to be
updated at the same time to prevent an inconsistency
creeping in.
• If you must have multiple references to the same
requirement, write it once, and refer to it by number or
name.

33
Practice Exercises

34
Example #1
• In your group analyze the following requirement, taken from an actual
requirement document, against the five characteristics of a good
requirement (listed below for reference).

"The product shall provide status messages at regular


intervals not less than every 60 seconds."

Each requirement should be:


* Correct
* Feasible
* Necessary
* Unambiguous
* Verifiable
The material in this Module is adapted from the article
Writing Quality Requirements by Karl Wiegers published
in Software Development, May 1999.

35
Example #1: Possible Resolution
"The product shall provide status messages at regular
intervals not less than every 60 seconds."

• This requirement is incomplete: what are the status messages and how are
they supposed to be displayed to the user?
• The requirement contains several ambiguities. What part of "the product"
are we talking about? Is the interval between status messages really
supposed to be at least 60 seconds, so showing a new message every 10
years is okay? Perhaps the intent is to have no more than 60 seconds
elapse between messages; would 1 millisecond be too short? The word
"every" just confuses the issue.
• As a result of these problems, the requirement is not verifiable.

36
Example #1: Possible Resolution (cont’d)
"The product shall provide status messages at regular
intervals not less than every 60 seconds."
Here is one way we could rewrite the requirement to address its shortcomings:

1. Status Messages.
1.1. The Background Task Manager shall display status messages in a
designated area of the user interface at intervals of 60 plus or minus 10
seconds.
1.2. If background task processing is progressing normally, the percentage of
the background task processing that has been completed shall be displayed.
1.3. A message shall be displayed when the background task is completed.
1.4. An error message shall be displayed if the background task has stalled.

Splitting this into multiple requirements makes sense because each will require separate
test cases and because each should be separately traceable. If several requirements are
strung together in a paragraph, it is easy to overlook one during construction or testing.

37
Example #2
• In your group analyze the following requirement, taken from an actual
requirement document, against the five characteristics of a good
requirement (listed below for reference).

"Charge numbers should be validated on-line against the


master corporate charge number list, if possible."

Each requirement should be:


* Correct
* Feasible
* Necessary
* Unambiguous
* Verifiable

38
Example #2: Possible Resolution
"Charge numbers should be validated on-line against the
master corporate charge number list, if possible."

• Incomplete. What does "if possible" mean? If it’s technically feasible? If


the master charge number list can be accessed on line?
• Ambiguous. We should avoid imprecise words like "should." The
customer either needs this functionality or he doesn’t.

Here is a possible improved version of this requirement:

The system shall validate the charge number entered against the on-line
master corporate charge number list. If the charge number is not found
on the list, an error message shall be displayed and the order shall not
be accepted.

39
The Inherent Difficulty of Requirements

40
Requirement Principle #1
Bad requirements lead to unsuccessful projects.

Requirements drive all other aspects of a project. If the requirements are


incorrect or incomplete, no matter how perfectly the design and
implementation are conducted, the results will not meet customer
expectations.

41
Requirement Principle #2
Requirements must be discovered, not just gathered.

Customers will not think of everything they need to tell you, nor will they
be able to communicate easily everything they intend to communicate.
Customers may not even have a good understanding of the problem they
are seeking to solve. The analyst should view himself or herself as a
consultant and a problem solver, whose job is to help the customer to
discover the true problem to be solved and what a good solution would
entail.

42
Requirement Principle #3
Requirements discovery is a process not an event.

Requirements discovery is an iterative process. You must articulate


requirements then validate them with the customer, then repeat the
whole process. Taking things at face value after one customer meeting or
communication is a sure way to produce incorrect and incomplete
requirements, and may even lead to an attempt to solve the wrong
problem completely.

43
Requirement Principle #4
Good requirements demand customer involvement.

No project will be successful if the customer’s expectations aren’t met;


customer expectations can’t be meet if they aren’t well-understood; only
the customer will be able to articulate his or her true expectations.

44
Requirement Principle #5
Requirements are never perfect.

Requirements discovery is a difficult iterative process. At some point, the


requirements must be baselined, so design can begin. Just accept that
there will always be something forgotten or misunderstood no matter
how long you take to discover the requirements. Make your best effort
within the time your project allots and move on, knowing that some
changes may be necessary as you learn more later. Don’t fall into analysis
paralysis waiting for the perfect set of requirements to appear.

45
Requirement Principle #6
Change in requirements is inevitable.

Because requirements are never perfect, we must accept the inevitability


of change as we and the customer discover new insights about the
requirements as the project progresses. Gain acceptance from the
customer of a viable and reasonable change control process at the
beginning of the project instead of making the unrealistic assumption
that the requirements are finalized when baselined.

46
Getting Requirements
Traditional methods of collecting systems requirements include:
• Individual interviews
• Observing workers
• Pro: People often do not have a completely accurate appreciation of what
they do or how they do it.
• Con: People may become uncomfortable or change how they work when
under observation
• Group interviews
• Questionnaires

You might also like