Online Eiffel Documentation |
Documentation Home > Tools > EiffelStudio > EiffelStudio Reference > Metric tool > Definitions |
EiffelStudio |
Units |
Metrics will be expressed in units, such as Line (numbers of source lines) or Feature (number of features).
Unit rule: The definition of any metric must specify an associated unit.
Different metrics may be marked with the same unit; for example metrics such as number of non-comment lines and number of comment lines may both be marked with the unit Line.
Whenever we need to express ratios of one measurement to another, as in computing the average number of features per class by dividing the number of features by the number of classes, we will use a specific unit, Ratio:
"Ratio unit": The name Ratio denotes a predefined unit, whose values are arbitrary real numbers, expressed either as numbers or in percentage style (as in 35.3%).
As a result of this choice, we will consider every division to yield a result of unit, Ratio.
The following predefined units are available in the metric tool:
Unit | Quantities measured | Kind |
Class | Number of classes or types | Product |
Feature | Number of features | Product |
Target | Number of targets | Product |
Group | Number of groups | Product |
Assertion | Number of assertion clauses | Product |
Argument | Number of arguments of a routine | Product |
Local | Number of locals of a routine | Product |
Line | Number of source lines | Product |
Compilation | Number of compilations | Process |
Ratio | Results of divisions | Product |
The units listed here are minimal in the sense that it is not possible to add the properties measured by any two of them; for example it makes no sense to add a number of features to a number of classes.
In the future, it might be desirable to include more specific units, such as "features per class" , and an associated calculus of units (as in the physical sciences, where multiplying a quantity expressed in g /cm by one in cm yields a result in g). This has not appeared necessary for the typical uses of division envisioned in this note, answering such questions as "What percentage of routines have a header comment" and all expressed as simply as Ratio.
Copyright 1993-2006 Eiffel Software. All rights reserved. |