Source: https://www.testbytes.net/blog/data-flow-testing/
Data Flow Testing, viewed as a nuanced approach in software testing, is the process of examining data variables and their values through the use of the control flow graph. Data Flow Testing is an example of white box and structural testing. By targeting gaps that become prevalent within path and branch testing, data flow testing aims to locate bugs from the misuse of data variables/values.
Data flow testing is used on both static and dynamic levels. In static levels, data flow testing involves the analysis of source code without actually running the application. The control flow graph in this instance represents execution paths of the code from the application. Errors that can be found on the static level include, definition-use anomalies (a variable is defined but is never used), redundant definitions (variable is defined multiple times before it’s used), and uninitialized use (a variable is used before a value has been assigned).
On the dynamic level, the application is executed, and the flow of data values/variables is analyzed. Issues that can be found on this level include, data corruption (value of a variable is modified in an unexpected way, leading to undesirable behaviors), memory leaks (unnecessary memory allocations, memory consumption becomes uncontrolled), and invalid data manipulation (data is manipulation in an unpredicted way, causing many outputs).
The steps of data flow testing include identifying the variables, constructing a control flow graph, analyzing the flow of data, identifying anomalies in the data, dynamic testing, designing test cases and executing them, resolving anomalies, and documentation. I decided to read about data flow testing because I thought it’d be valuable to learn about how this type of testing allows for early bug detection and overall improved code quality and maintainability. The obvious downsides however are that not every possible anomaly can be caught, the process can be time consuming, and other testing techniques should also be used.
From the blog CS@Worcester – Shawn In Tech by Shawn Budzinski and used with permission of the author. All other rights reserved by the author.