tags:

views:

87

answers:

3

I want to measure API evolution for a given Java project, in particular new/renamed classes, new methods, newly deprecated methods, etc. Is there a tool that detect such changes?

Back in 2007, a Google GSoc project was initiated, however, I cannot find the final work.

+3  A: 

I'd use Clirr for that, a binary compatibility checker. From the Clirr web site:

What is it?

Clirr is a tool that checks Java libraries for binary and source compatibility with older releases. Basically you give it two sets of jar files and Clirr dumps out a list of changes in the public api. The Clirr Ant task can be configured to break the build if it detects incompatible api changes. In a continuous integration process Clirr can automatically prevent accidental introduction of binary or source compatibility problems.

...

Features

  • Report all API changes (currently only partially implemented)
  • Evaluate each change wrt. binary and source compatibility
  • support plain text and XML reports
  • Flexible failure handling (warnings vs. errors, break the build or set error property)
Pascal Thivent
+1  A: 

Btw there seems to be an api-checker in the gwt source code, don't know if that is the product of the mentioned GSoc project.

GwtJavaApiCompatibilityChecker is also used in build.xml

jitter
This is the actual project I was referencing!
notnoop
+1  A: 

JDiff is maybe also worth a mentioning.

JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared. This is very useful for describing exactly what has changed between two releases of a product. Only the API (Application Programming Interface) of each version is compared. It does not compare what the source code does when executed.

As I understood it runs on the sourcefolder of the old version and generates an xml file. The same for the sourcefolder with the new version. Than the two xml-outputs are compared and a changelist compiled. In html-javadoc-api-style

jitter
JDiff runs on the **Javadoc** of the code, not on the code. It is a good companion to Clirr (if you can trust the Javadoc) and it is mentioned in the related projects (http://clirr.sourceforge.net/related.html). But I prefer something that work at the code level.
Pascal Thivent