You are on page 1of 18

Tracing Requirements

The Role of Traceability in
Systems Development
 Experience has shown that the ability to
trace requirements artifacts through the
stages of specification, architecture,
design, implementation, and testing is a
significant factor in assuring a quality
product.
 Software developed in many areas for
certain customers may have mandated
traceability requirements (e.g. the FDA).
Definition of Traceability
 According to IEEE [1994] traceability is:
 “The degree to which a relationship can be
established between two or more products of the
development process, especially products having a
predecessor-successor or master-subordinate
relationship to one another; for example the degree
to which the requirements and design of a given
software component match.”
 “The degree to which each element in a software
development product establishes its reason for
existing; for example, the degree to which each
element in a bubble chart references the
requirement it satisfies.”
The Traceability Relationship

 A traceability relationship is a
dependency relationship between two
project elements.
Element B is in some way
A Dependent on element A

traces

B
The Traceability Relationship
(Cont’d)
 A dependency relationship states that a
change in one element (e.g., a use case)
may affect another element (e.g., a test
case), but the reverse is not necessarily true.
 Additional meanings associated with the
traces (or traced by) relationship can be
inferred from the context. E.g., in the
previous example, the relationship infers that
the use case is “tested by” the test case.
A Generalized Traceability
Model
System Stakeholder Need
Definition traces
Implementation
Product Feature

traces traces

Supplementary traces Use-Case
Use Case
Requirements Realization

traces System Test traces

Test Cases Test Cases
Tracing Requirements in the
System Definition Domain
 This is called requirement-to-
requirement traceability.
 It includes:
 Tracing user needs to features
 Tracing features to use cases
 Tracing features to supplementary
requirements
Tracing User Needs to
Features
Traceability Matrix: User Needs versus Features

Feature 1 Feature 2 ... Feature n

Need 1 X
Need 2 X X
… X X
Need m X
Examining the Traceability
Matrix for Possible Errors
 If inspection of a row fails to detect any Xs, a
possibility exists that no feature is yet defined to
respond to a user need. This might be
acceptable, but it raises a red flag.
 If inspection of a column fails to detect any Xs,
possibility exists that a feature has been
included for which there is no defined product
need.
 The traceability matrix can be helpful when
changes in user needs occur.
Tracing Features to Use
Cases
 It is important to ensure that the features
can be related to the use cases
proposed for the system.
 A matrix similar to the Needs versus
Features matrix can be used.
Tracing User Needs to
Features
Traceability Matrix: Features versus Use Cases

Use Case 1 Use Case 2 . . . Use Case k

Feature 1 X X
Feature 2 X X
… X
Feature n X X
Examining the Traceability
Matrix for Errors
 If inspection of a row fails to detect any
Xs, a possibility exists that no use case
is yet defined to respond to a feature.
This is a red flag.
 If inspection of a column fails to detect
any Xs, a possibility exists that a use
case has been included for which there
is no known feature that requires it. That
is, this use case may not be required.
Tracing Features to
Supplementary Requirements
Traceability Matrix: Features versus Supplementary Requirements

Supplementary Supplementary . . . Supplementary
Requirement 1 Requirement 2 Requirement p
Feature or X X
Sys Req 1
Feature or X X
Sys Req 2
… X X
Feature or X
Sys Req j
Tracing Requirements to
Implementation
 First we trace use cases to use case
realizations as we did before.
 We then follow the traceability relationship to
the component parts of the use case
realization, the classes (code).
 We must do something similar for
supplementary requirements. In this case we
trace the requirements to a collaboration (which
we need to name since it doesn’t come from a
use case). See next slide.
Tracing Supplementary
Requirements to Implementation

Requirements Design Model

<<trace>>
- The clocks shall . . . Sync Clock
- Every 24 hours . . .

- Synchronization occurs . . .
Collaboration

Participating classes
Tracing from Requirements to
Testing
 A comprehensive approach to testing is to
assure that every use case is tested by one or
more test cases.
 In fact, each possible scenario for a use case
needs to be tested by one or more test cases.
 We can create a traceability matrix that maps
use cases to test cases.
 Requirements that are not expressed as use
cases are either traced individually to scenarios
and test cases or grouped into “requirements
packages” that operate in the same logical
fashion as use cases.
Traceability Matrix for Use
Cases to Test Cases
Use Case Scenario Number Test Case ID

Control Light 1 1.1

2 2.1

3 3.1

4 4.1

4 4.2

4 4.3

5 5.1

6 6.1

7 7.1

7 7.2

8 8.1

Run Vacation Profile 1 1.1
Mechanisms for Managing
Traceability Matrices
 For a large project creating and managing
the traceability matrices can be an
overwhelming task due to the problems of
correctly updating the information when
changes (e.g., to requirements) occur.
Mechanisms to help include:
 Spreadsheets
 Relational Data Bases
 Specialized Traceability Management Tools