Mohsen Vakilian's Blog

February 6, 2008

Automatic Change Inference

Filed under: evolution,refactoring — mohsenvakilian @ 12:12 am

The research question addressed in this paper is:

“Given two versions of a program, what changes occurred with respect to a particular vocabulary of changes?”

Of course, we are looking for higher level approaches for reporting changes than traditional diff tools which define a change vocabulary in terms of delete, add, and move line.

Miryung Kim et al., presented their approach for change inference in a paper titled “Automatic Inference of Structural Changes for Matching Across Program Versions“.

By the following example you can get a feel of how the output of their tool looks like:

for all x in chart.*Plot.get*Range()
except {chart.MarketPlot.getVerticalRange}
argAppend(x, [ValueAxis)

This change rule, means that all methods that match the chart.*Plot.get*Range() pattern take an additional ValueAxis argument, except the getVerticalRange method in the MarkerPlot class.

As shown in the above example, their approach represents structural changes as a set of high-level change rules, automatically infers likely change rules and determines method-level matches based on the rules.

The set of transformation that they support are (1) refactorings such as rename package/class/field/method, add parameter, … (2) other transformations such as change argument types, change return types, change input argument list, …

They did a good job of printing the change rules in a concise manner. As they mention, the except clause sometimes signals a bug arising from incomplete or inconsistent changes.

I think more types of transformations should be taken into account for better descriptions of changes. Besides, one might try to handle changes due to refactorings by just recording them while they are being performed rather than trying to infer them by comparing the two versions of program.

February 2, 2008

Subclipse Annotate View

Filed under: evolution — mohsenvakilian @ 5:26 pm

The SVN Annotate View is part of the SVN Repository Exploring Perspective and allows you to review the revision history for a specific file, right down to the individual line of code. As illustrated in the figure, The view is comprised of three distinct areas:

  1. The first pane shows a list of all the individuals that have changed this file along with the revision number and the total number of lines changed as part of that revision.Subclipse Annotate View
  2. The Eclipse text viewer showing the contents of the selected file at the head revision.
  3. The History View for the selected file.

The History View contains the list of all changes made to the selected file. For each change, the svn log and the list of all files affected in that commit are shown.

The History View and the view of the file contents are dynamically linked to the revision panel. Left clicking an entry in the revision pane will highlight all of the lines that were modified in the file in the text viewer. In the same way, when a line in the text viewer is selected, the revision author will be highlighted in the revision pane. The History View is automatically updated to provide the full details of each revision selected.

Subclipse Quick Diff

Filed under: evolution — mohsenvakilian @ 5:06 pm

Instead of using a compare editor, which will show changes between 2 or 3 files by showing each file side-by-side, you can enable quick diff support and see the changes within the text editor.

If you enable showing the differences in the overview ruler, you can, at a glance, get an idea of how many changes you have Subclipse Quick Diffmade to a file since your last commit. As shown in the figure, the overview ruler is segmented such that each segment corresponds to a change made by a developer. The darker a segment is the newer the change is. If you hover over a particular segment, the svn log of its corresponding commit will pop up.

Subclipse Compare

Filed under: evolution — mohsenvakilian @ 4:22 pm

Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE.
In the following posts, I’ll mention some features of Subclipse that I found interesting in investigating the history of changes made to a software code base.

The Subclipse Compare tool shows the differences among the selected files in two views: Java Source Compare and Java Structure Compare.Subclipse Compare
As show in the figure, the Java Source Compare pane is much like ordinary diff tools in the way it shows the differences by connecting a piece of code in the new version to the corresponding one in the old version.
The Java Structure Compare pane gives us an overall view of how the selected class has evolved. You can tell from the figure what methods have been added and removed from the class. I found the idea of showing changes in a high-level structural view interesting. However, I think more can be done in this regard to give the developer a better understanding of changes. Please feel free to leave your comments on how the Subclipse Compare tool can be enhanced.

Update: As Mark Phippard (the project lead for Subclipse) stated in his comment, the Compare Tool is part of Eclipse itself. I was merely explaining the kind of features one gets by installing the Subclipse plug-in for Eclipse. Therefore, I was careless about making distinctions between components provided by Eclipse and those provided by Subclipse.

Blog at