Add more graphs and generalize CFG and control dependence creation
Created by: cargaji
Added support for the ACFG
, APDG
and PPDG
, including tests and comparison of the slices.
Other changes:
- Renamed graphs from
??GGraph
to??G
, as theG
stands forGraph
. - Improved slicing:
Graph#slice()
returns aSlice
, which is a set of ids easily transformed into an AST viaSlice#toAst()
. Nodes could be extended so that they could be colored if they are in a slice (viaSliceable#colorNodes(Slice)
orPDG#colorNodes(Slice)
and remove them withPDG#clearColor()
). - Improved control dependence generation: switch from AST visitor to postdominance (see #3 (closed) for details). Fixes #3 (closed).
- Testing:
PDGTests
compares all available PDG variations, and compares all possible slices for a set of methods. Tests fail when differnent PDGs obtain different slices, which doesn't mean the slices are wrong. A test set of tuples(method, criterion, slice)
is needed to automatically validate the slices produced.