Since there is no standard formalism for defining software
metrics, many of the measures that exist have some ambiguity in their
definitions which hinders their comparison and implementation. We address
this problem by presenting an approach for defining software metrics.
This approach is based on expressing the measures as Object Constraint
Language queries over a language metamodel. To illustrate the
approach, we specify how the Chidamber and Kemerer metrics suite can
be measured from Unified Modelling Language class diagrams by presenting
formal definitions for these metrics using the Unified Modelling
Language 2.0 metamodel