Java aware sources comparison

Few months ago I was searching a tool that would compare two versions of Java source with respect to its OO structure. I expected that report would give me an info not only with number of changed lines in a file but rather number of changed methods and number of lines in them. I found nothing that can fulfill this task.

I decided to build a small tool that would derive this information from Beyond Compare report saved in XML. It uses pipelining concept to achieve final result and it consists of following steps:

  • formatting sources using Jalopy Ant steps
  • making text diff expressed in XML using Beyond Compare
  • recognizing method structures using XSLT 2.0
  • analyzing methods and recognizing change types in them
  • summarizing results as metrics in HTML report

In particular use last step can be replaced with custom report or statistics. At the end we can check how many classes and how many methods are changed in a module. We can also find how big are these changes (in number of lines) and what kind they are (added or conflicted). Example summary page is shown below.


Additionally one can check plain diff of a class as visible below.


The tool you can download from my files site.

0 komentarze:

Post a Comment