Code Metrics

On this page we plan to give some metrics that show how good (or bad) HeRA's codebase is at a given milestone. Tehgoal is to continously improve HeRA.

State at Milestone Post SoSe'09

First, we have to admit that our database is really poor. For core, critiques, and requirements extensions, we have some pretty old data from past educational projects. The requirements extension was created during that effort.

Lines of Code

Lines of Code give a general feeling about the size of each component.

  • hera.requirements and hera.critiques have grown since the last measurement was taken two years ago. This was expected
  • hera.core has lost nearly 3000 LOC during the same period. Some of this functionality was moved to hera.usecases. We think that this loss of weight is an improvement for the core component, since it makes quality assurance easier.
  • hera.usecases currently is the second largest component, right after core.
  • hera.critiques has lost many lines of code since the last milestone in May (ICSE'09). Basically, we removed the code from Sinan's Master's thesis to a new extension.

Asserts and Fails

We count JUnit Assert and Fails to measure testing effort.

This figure shows good and bad news. The good news is that hera.core and hera.requirements have gained tests during their evolvement. When code was transfered from HeRA to hera.usecase, many new tests were added.

The bad news is that we lost more than 100 asserts and fails in hera.critiques and we have no idea when and how this has happened (see #141).

Testcoverage

The line coverage gives another hint of the quality of tests.

  • The coverage of the hera.requirement was initially very high (90+ %), because it was created in an eXtreme Programming class based on the testfirst practice. It still has a coverage of 86 %.
  • The coverage of hera.usecase is at 80 %, thanks to the efforts of Sebastian.
  • The coverage of hera.core is constant at a slightly to low level of 43 %. It is very hard to increase the coverage. This can be seen by the fact that the number of asserts was increased while the lines of code were decreased, without any effect on the test coverage.

McCabe?

McCabe? values do not change as frequently as other metrics, so we do not provide line charts here. The following table gives an overview of the four most important components:

Component McCabe? Mean McCabe? Std. Dev. McCabe? Max
hera.core 1.588 1.324 15
hera.critiques 1.716 2.015 29
hera.requirements 1.286 0.832 9
hera.usecase 1.637 1.333 12

We should really try to improve the situation in hera.core and hera.critiques.

Attachments