# Data Flow Analysis

> Following a value through a program. You see where it starts and where it ends.

**Field:** Software Development  
**Category:** Code Intelligence  
**Also known as:** Dataflow Analysis, Taint Analysis, Taint Tracking

## Think of it like

It is like dropping dye in a river. Then you watch where the colour goes.

## Definition

Data flow analysis follows a value through a program, from where it is made to where it is used. It walks the control flow graph and tracks each variable on every path. It can tell if a value might be empty when it is used. A common use follows user input, called taint, to see if it reaches a database query unchecked. That is how many tools find injection bugs.

## Example

A scanner follows the search box text in Emma's app. It finds a path where the text reaches an SQL query with no checks.

## Why it matters

Many bugs are a value in the wrong place: empty, unchecked or leaked. This finds those paths.

## Common mistake

Thinking a clean scan means safe code. Data that flows through a file, a queue or another service is often lost from view.

## Three principles

- **Track values.** From where set to where used.
- **Every path.** It walks each branch.
- **Follow the taint.** User input must be checked.

## Related terms

- [Control Flow Graph (CFG)](https://learn.benibix.com/term/development/control-flow-graph)
- [Static Analysis](https://learn.benibix.com/term/development/static-analysis)
- [Injection Attack](https://learn.benibix.com/term/development/injection-attack)
- [Variable](https://learn.benibix.com/term/development/variable)
- [Code Graph](https://learn.benibix.com/term/development/code-graph)

![Two panels. On the left, a dependency graph: the app module imports an auth module and a billing module, and both import a shared utils module, lit up. On the right, a control flow graph for one function: a start box, a diamond asking if the user is logged in, a yes path to show the page and a no path to send to login, both meeting at an end box. A dotted line follows one variable from where it is set to where it is used.](https://learn.benibix.com/diagrams/dev4-flow-graphs.svg)

---

Source: https://learn.benibix.com/term/development/data-flow-analysis
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
