views:

79

answers:

2

For an assignment we have to extract some software metrics from the Hibernate project. We have to extract the afferent coupling and efferent coupling metrics (dependency fan-in, fan-out) from each revision of each package in Hibernate. Some tools were provided which are able to extract these metrics, such as ckjm and JDepend. Other tools I have checked were Sonar, javancss and AOP. There is also the Metrics Eclipse plugin which I didn't get to work either.

What these tools have in common, as far as I can see, is that they all operate on bytecode (*.class files). This is a problem, because I have to build every revision from source in order to run, say, JDepend on it. Older revisions won't build because my development stack is too recent. What I would like to do is to do this kind of analysis on source files so that I don't have to build each revision. Is this possible? Or is there a good reason why all these tools only operate on bytecode?

A: 

Try this: http://sourceforge.net/projects/hibernate/files/hibernate3/

You can download the Jar files for numerous old revisions here.

The reason these tools work on bytecodes is generally because it's simpler to write a bytecode parser than a full source code parser, plus it also allows you to cover 3rd party libraries where you don't have the source.

Paolo
Yes, I am aware I can download older versions, but that's too coarse grained. We are asked to pick interesting revisions based on some metrics and do some further processing.
Bram Schoenmakers
Hmm, well then it depends on your (or your teacher's) definition of "revision" I guess. I'd argue that comparing point releases e.g. v3.2.5 and v.3.2.6 is valid, but maybe that's not what the assignment says :)
Paolo
A: 

We found that cccc is capable of gathering metrics on source code (LOC, McCabe's complexity, CK and HK). Perhaps it works on simple project, but running this over all Hibernate code resulted in a large amount of parse errors. Moreover, it stops with a segmentation fault in the end, leaving us with an incomplete report.

In the end, we resorted to write our own script which processes the files to gather the necessary information. It's not water-proof, since it does not actually parse Java but just looks for certain patterns, but it's good enough for now.

Bram Schoenmakers