Definition-use Pair
A definition-use pair is a relationship between where a variable receives a value and where that value is subsequently used within a program.
“The association of a definition of a variable with the subsequent use of that variable.”
(Definition reproduced from the ISTQB Glossary. Copyright belongs to ISTQB.)
View the complete ISTQB GlossaryWhat is Definition-use Pair?
Definition-use pairs are analyzed during data flow testing to ensure variables are properly initialized and used before being modified again.
Definition: A variable is assigned a value.
Use: The assigned value is referenced later in the program.
Testing value: Helps identify data flow defects such as uninitialized or unused variables.
Real World Example
An insurance system calculates a customer's premium using a discountRate variable that gets set based on the customer's loyalty tier and is later used in the final premium formula.
Statement and branch coverage on the module already look complete, yet a defect still reaches production: on the renewal path, a stale discountRate from a previous calculation slips through into the premium formula instead of the freshly determined one.
A tester familiar with Definition-use pairs maps every place discountRate is assigned to every place it is later read, and designs data flow test cases that trace each definition through to its use — including the renewal branch that reassigns the tier partway through processing.
The stale-value defect is caught by deliberately exercising the definition-to-use path on renewals, a case that passing statement and branch coverage numbers had completely masked.
Practice Questions
Question 1
A premium calculation module has 100% statement and branch coverage, yet a defect still reaches production: on the renewal path, a stale discount value from an earlier calculation is used instead of the newly determined one. Which test design concept would MOST directly have targeted this defect?
Question 2
In data flow testing, which pair of events forms a definition-use pair?
Test your knowledge with real ISTQB-style questions
You’ve learned Definition-use Pair. Test your understanding with topic-specific questions in our Mock Exams.