开发者

Detecting API changes/evolution [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 4 years ago.

Improve this question

I want to measure API evolution for a given Java project, in particular new/renamed class开发者_如何学运维es, 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.


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)


There's also a new API evolution checking tool called Revapi


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


Try japi-compliance-checker tool. It's open-source. The tool shows API changes and detects both backward source (SC) and backward binary (BC) compatibility issues between two jar archives:

japi-compliance-checker -old LIB-0.jar -new LIB-1.jar

Sample reports for log4j: http://abi-laboratory.pro/java/tracker/timeline/log4j/

Detecting API changes/evolution [closed]

You can find classification of found compatibility problems by severity level in the reports for particular library versions:

Detecting API changes/evolution [closed]


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


You might also want to try japicmp.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜