School of Computer Science
    
SemDiff

Recommending Adaptive Changes for Framework Evolution

News

[January 8th, 2010] SemDiff 2.2.0 is out:
  • Requires Eclipse 3.5.
  • Supports PPA 1.1.1.
  • Supports submodules in cvs repositories (e.g., a path could be org.eclipse.jdt.junit4.runtime/src instead of org.eclipse.jdt.junit4.runtime)
  • Supports remote queries through JSON. See plug-in ca.mcgill.cs.swevo.semdiff.remote for more info.
  • Previous version of SemDiff (Eclipse 3.4) is still available at: http://www.cs.mcgill.ca/~swevo/semdiff/site_2.1.x
[May. 14th, 2009] SemDiff 2.1.1 is out. More History Explorer queries available. Support for PPA 1.0.9.
[Feb. 24th, 2009] This is a major release of SemDiff that breaks the compatibility of previous SemDiff repositories. Do NOT update if you want to preserve your current repositories or contact Bart for indications on converting your old repositories.
  • Changed structdiff to detect changes in import statements and extends statements.
  • Fixed CallDiff to support new changes in structdiff (more call differences are detected).
  • New Database schema: old databases can be updated (contact the Bart for more information), but it is recommended to create a new database and start over (no need to download the source files again though).
  • Added new preferences in CallDiff detector (maximum number of calls is now customizable) and the Recommender (transaction number upper limit is now customizable: useful to get recommendations for a specific version).
  • Added History Explorer (right-click on a call and select SemDiff-Get Call History: useful to know what happened to a certain method during the evolution of a framework).
  • Support for PPA 1.0.8.
[Jan. 21st, 2009] Update site upgraded to support PPA 1.0.7.
[Jan. 11th, 2009] SemDiff 2.0.2 is out. Better heuristics to recover CVS transactions. Added log detector (generate text log for StructDiff and file differences). Added more preferences. Support for PPA 1.0.6.
[Nov. 20th, 2008] SemDiff 2.0.1 is out. Overwriting existing analysis results now works (old results were not deleted before). Two bug fixes related to the recommender user interface. Support for PPA 1.0.5.
[Oct. 10th, 2008] SemDiff 2.0.0 is out.
   

Overview

In the course of a framework's evolution, changes ranging from a simple refactoring to a complete rearchitecture can break client programs. Finding suitable replacements for framework elements that were accessed by a client program and deleted as part of the framework's evolution can be a challenging task. SemDiff is a recommendation system that suggests adaptations to client programs by analyzing how a framework adapts to its own changes. SemDiff also provides a repository analysis framework that can be used by researchers to study the evolution of any software products developed with CVS or Subversion.

Quick Start


Analyzing a CVS Repository

This tutorial will guide you through the steps of analyzing the history of an Eclipse project, org.eclipse.jdt.junit4.runtime. We will assume the following directory structure:

Note to Windows user: you can replace all paths by C:\your_path. For example, C:\semdiff\db is a valid path for Windows.

Overview

  1. Initialize SemDiff database so it has the right structure.
  2. Define a local profile to tell SemDiff to perform the analysis on your machine (as opposed to communicating with a remote instance).
  3. Create a repository to indicate to SemDiff where to find project versions information.
  4. Retrieve repository history log.
  5. Analyze the first 10 transactions.

Steps

  1. Install SemDiff

  2. In the SemDiff menu, select "Init Database". Enter the following information:

    • Username: sa
    • Password:<Leave it empty>
    • Connection String: jdbc:hsqldb:file:/home/myuser/semdiff/db/hsql;hsqldb.default_table_type=cached
    • Driver: Choose "org.hsqldb.jdbcDriver"
    • Dialect: Choose "org.hibernate.dialect.HSQLDialect"
  3. Push on OK. A dialog should appear telling you that the initialization went well.

  4. Open the repository view. Go to Window -> Show View -> Other... -> SemDiff -> SemDiff Repositories

  5. In the SemDiff Repositories view, click on the "Manage Profiles" button. Push on Add Profile.

  6. A dialog will appear, select "Local Profile", then Next >. Enter the following values:

    • Name: My Local Profile
    • Username: sa
    • Password: <Leave it empty>
    • Connection String: jdbc:hsqldb:file:/home/myuser/semdiff/db/hsql
    • Driver: Choose "org.hsqldb.jdbcDriver"
    • Dialect: Choose "org.hibernate.dialect.HSQLDialect"
    • Local director: <Leave it empty>
    • Same as Repository: <Checked>
  7. Push on Finish, then OK.

  8. Your profile should appear in the SemDiff Repositories View. Push on the "Add Repository" button (the green cross). A dialog should appear.

  9. Select the CVS repository type, push Next >. Enter the following values:

    • Name: Eclipse JUnit 4 Runtime
    • Description: Eclipse JUnit 4 Runtime
    • Log directory: /home/myuser/semdiff/junit/log
    • Server directory: /home/myuser/semdiff/junit/source
    • Repository connection string: :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
    • Repository paths: org.eclipse.jdt.junit4.runtime
    • Date format: yyyy-MM-dd hh:mm:ss Z <The default value already entered>
  10. Push on Finish. Select the new repository, Eclipse JUnit4 Runtime, and activate it (the green circle button, or right-click on the repository and select "Set Active Repository").

  11. Select the menu SemDiff -> CVS Repository -> Generate RLog. Wait until it is completed.

  12. Select the menu SemDiff -> Run Detectors. A dialog will appear. Enter 0:10 and then push OK.

  13. Open the Transactions view. Go to Window -> Show View -> Other... -> SemDiff -> Transactions

  14. Push on the Goto transaction button (the yellow arrow) and enter 6.

  15. You can now see information about the transaction 6. You can also right click on any item to see the source of the versions of the file.


User Guide


Concepts

There are a few concepts that you need to understand before using SemDiff. Some are general concepts commonly discussed in the software evolution literature, while some other are specific to SemDiff.



Initializing a Database

To use SemDiff, you need to setup a database that will store the various results computed by SemDiff. SemDiff supports two databases: HSQLDB and PostgreSQL. Once you have selected the database you want to use, you need to initialize it: when selecting the menu option "SemDiff / Init Database", SemDiff creates the appropriate schema (tables, constraints, etc.) in the database.



Creating a Profile
How to create a profile. The various types of profiles.

Creating a Repository
How to create a repository. The various types of repositories.

Analyzing a Repository
How to launch the analysis of a repository.

Getting a Recommendation
How to use the recommender.

Creating a Custom Detector
How to create a custom detector.

Download

System requirements: Eclipse 3.4, Java 1.5 or later. To create your own repositories, a minimum of 2 GB RAM is recommended and you will need to use HSQLDB (embedded in SemDiff) or PostreSQL. SemDiff has been tested on Linux and Windows.

SemDiff can be easily installed through the Eclipse's update mechanism. SemDiff is distributed under the terms of the GNU Lesser General Public License, version 3.

To install SemDiff:

  1. From the Eclipse menu bar, select Help | Software Updates...
  2. Select the tab "Available Software".
  3. Push on the Add Site... button.
  4. Enter http://www.cs.mcgill.ca/~swevo/semdiff/site_2.x, and click OK
  5. Select the SemDiff category* and the two features (SemDiff and Partial Program Analysis for Java) in the list and click Install...
  6. Push Next.
  7. Select that you accept the terms of the license agreement, and click Finish.
  8. Restart your workspace.

* Because there is a bug in the new provisioning system in Eclipse 3.4, you will see "Uncategorized" if you use p2 instead of the old update site mechanism.

Publications

Original Paper:

Barthélémy Dagenais and Martin P. Robillard. Recommending Adaptive Changes for Framework Evolution. In Proceedings of the 30th ACM/IEEE International Conference on Software Engineering, pages 481-490, May 2008. [ACM SIGSOFT Distinguished Paper Award]. (pdf).

Other publications using SemDiff:

Martin P. Robillard and Barthélémy Dagenais. Retrieving Task-Related Clusters from Change History. To appear in Proceedings of the 15th Working Conference on Reverse Engineering, October 2008. pdf
Martin P. Robillard and Putra Manggala. Reusing Program Investigation Knowledge for Code Understanding. In Proceedings of the 16th IEEE International Conference on Program Comprehension, pages 202-211, June 2008. pdf

Issues

Search and report bugs and feature requests with SemDiff using Bugzilla (Product: SemDiff).

People

SemDiff was developed by Barthélémy Dagenais with contributions from Martin Robillard.

Contact Information

Address questions, and comments to Barthélémy at bart at cs dot mcgill dot ca.

Valid XHTML 1.0 Transitional