Program dataflow

When debugging a fault, it is helpful to think abou how data flows through the program. In program fault research, this is called 'slices'. You can think about slices as dependency chains for variables and data.

A forward slice is all the variables changes which will be affected by a certain change. A backwards slice is all the variable changes that have contributed to the current state. Since slices represent the set of change to program state, you can apply set operations, like intersection and differences, to these to track down why things are happening.

Debuggers and analyzers can help us use both of these ideas. This is most obvious with reverse debuggers, since we can easily work forwards and backwards. Following dependency chains is sometimes easier in the development environment. Figure out how your tool works.

To follow forward dependencies, you can find all references that use a certain variable, then use the debugger to see when those code lines are executed. A reverse debugger allows the same thing to happen for backwards dependencies.

Since variable actions can be classed as read or writes, some tools have support for marking these actions on variables. Static analysis can find intended use, but dynamic watches can find unintended actions (say, from incorrect pointer access).