Department of Electrical and Computer Engineering

 

Structural Comparison Tools

We have developed structural differencing tools to show changes between two arbitrary versions of

  1. a system's hierarchical structure (e.g. file-directory hierarchy)
  2. any structured component (e.g. source code or structured documentations)
  3. any logical unit (e.g. syntactical unit in a program or a document node) in both structural and line-oriented fashions.

The compared versions are not necessarily predecessors or successors of each other. The tools are based on the Versioned Unit Slot Information (VUSI) mechanism. VUSI attaches versioned slots of type ``boolean'' to nodes in a tree or a directed graph to track if there is a change in one or many attributes (including ``children'' and ``parent'') of a node between any two arbitrary versions. Their values will be changed from ``false'' to ``true'' to signify a change.

Figure 1. Structural comparison for a logical structure

Figure 1 shows the changes in the document-directory structure of a project between v4 and v7. The icon next to a
document's entry shows the change in its status from one version to another. For example, the ``pencil'', ``i'', ``eraser'', and ``truck'' icons represent a modification, insertion, deletion, and relocation of a component respectively. For a program or a structured document, Molhado visually displays the differences between two versions of any document
node (i.e. logical unit). If the chosen document node is the root of a component, changes of the entire component will be shown.

Figure 2 shows structural changes in a Java program. A small icon is attached to a document node icon, showing its changing status from version v7 to version v8: either it has been modified (a tree icon), inserted (an ``i'' icon), or deleted (an eraser icon). For example, the methods ``getRoot'' and ``setRoot'' have been deleted (see the
left window), the methods ``numChildren'' and ``parent'' have been added at version v8 (see the right window), while the body of the method ``doAnalysis'' has been modified to add a new expression (see the right window). Developers can also select a structural unit and choose an option to display changes of a text node in line-by-line fashion similar to ViewCVS (See Figure 3).

Figure 2. Structural comparison for a Java program

Figure 3. Line-oriented differencing when users select a text node

Figure 4. Structural changes in a HTML document