ISTQB Mock App

Data Flow Analysis

Data flow analysis is a white-box analysis technique that examines how data is created, modified, used, and destroyed throughout a program.

Official definition
ISTQB Official Glossary Definition
A type of static analysis based on the lifecycle of variables.

(Definition reproduced from the ISTQB Glossary. Copyright belongs to ISTQB.)

View the complete ISTQB Glossary

What is Data Flow Analysis?

By analyzing variable usage and movement, data flow analysis helps identify defects such as uninitialized variables, unused data, or incorrect data handling.

Variable lifecycle: Tracks where variables are defined and referenced.

Defect detection: Reveals data-related programming errors.

Testing support: Helps design structural test cases targeting data usage.

Real World Example

A static analysis tool scans a payroll module's source code, without running it, and flags a variable called netPay that gets assigned a value and then reassigned again before ever being read.

That kind of pattern wouldn't necessarily fail any test today since the second assignment simply overwrites the first, but it can signal dead code or a deleted calculation step — and manually reviewing thousands of lines to spot lifecycle problems like this isn't realistic.

The team runs Data flow analysis across the codebase — a static technique based purely on the lifecycle of variables, with no execution required — to automatically flag definitions that are never used, uses that occur before any definition, and definitions overwritten before use.

Investigating the flagged netPay anomaly reveals a real defect: a tax deduction step was accidentally deleted, and the reassignment silently papered over the missing subtraction — caught purely by analyzing variable lifecycles in the source, before a single test was ever executed.

Practice Questions

Question 1

A tool scans a payroll module's source code without executing it, and flags a variable that is assigned a value and then reassigned again before ever being read. Which technique does this describe?

Question 2

What is the KEY difference between data flow analysis and data flow testing?

Test your knowledge with real ISTQB-style questions

You’ve learned Data Flow Analysis. Test your understanding with topic-specific questions in our Mock Exams.

Go to Mock Exams