What is ChopaChops?

ChopaChops is a collection of tools for slicing and chopping of graphs. Currently, only a single tools is included in the collection:

  • JReach: derives package graphs from Java sources, and allows them to be sliced or chopped according to various criteria.


A package graph contains nodes that represent Java packages and types (interfaces or classses) and their interrelationships. A package graph contains edges to represent the following types of relationships:

  • nesting: a type is nested inside a package or inside another type.
  • import: a type imports other types.
  • inherit: a type inherits from another type (class from class, or interface from interface).
  • implement: a class implements an interface.

These edge types are summarized in the following packge graph legend.


An example of a package graph:


Using JReach, one can compute slices and chops of the above package graph. For instance, the forward slice from software_improvers.clonedetection.metric.CloneDetector:


Or the backward slice from java.util.List and java.util.ArrayList:


And finally, the chop between software_improvers.clonedetection.metric.CloneDetector on one hand, and java.util.List and java.util.ArrayList on the other hand:


Additionally, JReach also allows to compute the union between slices rather than the intersection.

Graph slicing and chopping

The ChopaChops tools use functionality from the UMinho Haskell Libraries for representing and manipulating graphs. In particular, they use the modules in the Relation package.