5

I am working on an SDK. As I release new versions I would like to produce a report of the differences in the API. This is not the differences in the code. Most of the code is not expected to be used directly. The public classes/methods is what I am interested in. Furthermore, we have adopted the convention that anything in a namespace that includes Implementation should not be used by a client of the SDK. So I am looking for the differences in the public interfaces, classes and methods that are not in a namespace that includes Implementation. I want to know what has been removed, added and modified between two releases.

I found a tool from Microsoft called LibCheck that is in the right ballpark. I have a couple of issues with LibCheck. LibCheck does not recognize a method that has been modified. It reports the method as having been removed and added. It sometime reports a method as having been removed and added, but the name and parameters are all the same. I do not know what it is attempting to tell me in these cases. Finally I do not care for the layout of the reports. I would like a break down by namespace as well as by assembly and class.

I am aware that the reports are the result of an XSLT transform and I could make them look essentially anyway I want. Still the other issues coupled with a general lack of support for the tool from Microsoft leave me looking for an alternative.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Pat O
  • 1,344
  • 3
  • 12
  • 27
  • Related question: http://stackoverflow.com/questions/2377855/tool-for-backwards-compatibility-for-c-net-api – linuxbuild Jan 27 '11 at 16:27

2 Answers2

2

A tool such as NDepend is very much suited to this job, and has built in features for diff reporting at an "API" level rather than just textual e.g.:

Compare Builds and Code Diff

NDepend has its own code query language CQL which can be used to write highly customized static analysis reports:

Code Query Language

ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
Tim Lloyd
  • 37,954
  • 10
  • 100
  • 130
1

There's also http://apichange.codeplex.com that has a diffing option. Call it like this

ApiChange -diff -old $net2dir\System.dll -new $net4dir\System.dll

and you should get a report.

Dejan
  • 9,150
  • 8
  • 69
  • 117