Frequently Asked Questions

Frequently Asked Questions

Contents

The metrics calculated by the program do not agree with those I calculate by hand. How come?

The ckjm program calculates the metrics from the code appearing in the compiled bytecode files. The Java compiler optimizes away some elements of the code (for example static final fields, and these do not take part in the calculations. You may want to consult the disassembled code (using a command like javap -c -private to see what elements ckjm takes into account.

How can I run the tool in a JDK 1.4 environment?

You can use the open source tool retroweaver to create a backwards-compatible jar file. (Suggested by Paul King).

I'm getting a ClassNotFoundException. How can I fix it?

If you are getting messages like the one below, it means that ckjm can't locate the code for the corresponding classes, in order to properly calculate the depth of the inheritance tree (DIT) metric. java.lang.ClassNotFoundException: Exception while looking for class javax.servlet.http.HttpServlet: java.io.IOException: Couldn't find: javax.servlet.http.HttpServlet.class To solve this problem you must explicitly setup the java.ext.dirs property pointing to a directory containing the jar files where ckjm can locate those classes. Example: java -Djava.ext.dirs=lib -jar ckjm-1.8.jar *.class

I'm using ckjm to collect metrics for a research. How shall I cite it?

The extended version of ckjm was originally reported in:
Jureczko, M., Spinellis, D.: Using object-oriented design metrics to predict software defects. In: Proceedings of the 5th International Conference on Dependability of Computer Systems, pp. 69–81 (2010)

@Inbook{Jur10,
 author = {Jureczko, Marian and Spinellis, Diomidis},
 title = {Using Object-Oriented Design Metrics to Predict Software Defects},
 volume = {Models and Methodology of System Dependability},
 series = {Monographs of System Dependability},
 year = {2010},
 isbn = {978-83-7493-526-5},
 pages = {69-81},
 publisher = {Oficyna Wydawnicza Politechniki Wroclawskiej},
 address = {Wroclaw, Poland}
}