mistupv / JavaSlicer

A program slicer for Java, based on the system dependence graph (SDG).
https://mist.dsic.upv.es/JavaSlicer/demo/
GNU Affero General Public License v3.0
52 stars 18 forks source link

Implement method call nodes #6

Closed jacosro closed 4 years ago

jacosro commented 4 years ago

Currently, method call nodes (i.e. nodes which contain an expression corresponding to a method call) are not represented as different nodes (they are GraphNodes). Maybe, it would be a good idea to represent them separately in SDG, in order to build in/out variable nodes and work with them easily. This way, a new class MethodCallNode extending the GraphNode class would be created, containing references to in/out variable nodes.

This would only exist in the SDG, so this also implies, as the SDG is built by a composition of PDGs, that there should exist a visitor which converts GraphNodes from the PDG into MethodCallNodes

@cargaji What do you think? Any alternatives?

To do:

cargaji commented 4 years ago

The alternative would be to add extra parameter input and output to method calls. This would be done in the PDG:

The "creation" of the SDG is as simple as connecting each method call and its in/out nodes to all the matching method declarations (and their in/out nodes), plus adding summary arcs between in/out nodes.

cargaji commented 4 years ago

Useful material (papers):

cargaji commented 4 years ago

Locating which method call has been executed with JavaParser + JavaSymbolSolver: https://tomassetti.me/resolve-method-calls-using-java-symbol-solver/

jacosro commented 4 years ago

Closing this issue since it is completed for now. Opening new issues to refine it