Data-Flow Analysis
Data-flow analysis is a static analysis technique that tracks how values move and are transformed through a program — from where they are defined to where they are used — enabling tools to reason about program behavior without executing the code.
Data-flow analysis examines how data propagates through a program: which statements define a value, which use it, how values are combined, and which branches they can flow along. It underpins much of compiler optimization and static security analysis, because many bugs and vulnerabilities are really properties of how data moves.
Techniques include constant propagation and folding (resolving values that are known at analysis time), dead-branch elimination (pruning code that can never execute), and def-use tracking (linking each value's definition to its uses). Analysis can be intra-procedural (within a single function) or inter-procedural (following data across function calls), with the latter being more powerful but more expensive.
For developers, data-flow analysis is what lets a scanner understand context rather than just pattern-match text. It is the foundation for taint tracking, reachability, and precise vulnerability detection, and improving data-flow precision directly reduces both false positives (fewer spurious findings) and false negatives (fewer missed real issues).