Analytical Techniques - Static Analysis - Data Flow Analysis
6 important questions on Analytical Techniques - Static Analysis - Data Flow Analysis
What;s data flow analysis?
The lifecycle of each variable is investigated, (i.e., where it is declared, defined, read, evaluated and destroyed), since anomalies can occur during any of those operations or if the operations are out of sequence.
Name a data flow analysis technique and how does it work?
- d: when the variable is declared, defined or initialized
- u: when the variable is used or read in either a computation or a decision predicate
- • k: when the variable is killed, destroyed or goes out of scope
What's an alternative for the data flow technique definition-use notation?
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding
How do you use the three atomic actions in data flow analysis?
Name a few anomalies which can be used while performing a correct action at the wrong time or carrying out an incorrect action on data in a variable.
- Failing to assign a value to a variable before using it
- Taking an incorrect path due to an incorrect value in a control predicate
- Trying to use a variable after it is destroyed
- Referencing a variable when it is out of scope
- Declaring and destroying a variable without using it
- Redefining a variable before it has been used
- Failing to kill a dynamically allocated variable (causing a possible memory leak)
- Modifying a variable, which results in unexpected side effects (e.g., ripple effects when changing a global variable without considering all uses of the variable)
What's the disadvantage of data flow analysis?
For example, the static data variable may contain a pointer into a dynamically created array that does not even exist until runtime. Multi-processor usage and pre-emptive multi-tasking may create race conditions which will not be found by data flow or control flow analysis
The question on the page originate from the summary of the following study material:
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding
![Trustpilot Logo](/images/design_2020/lp/clp-trustpilot-en.png)