Page 200 - DCAP305_PRINCIPLES_OF_SOFTWARE_ENGINEERING
P. 200
Principles of Software Engineering
Notes 9.3.3. Criteria for Evaluating Cohesion Metrics
In this framework, they described the structure of any measure as containing the entities being
analyzed, such as classes or modules; the attribute being measured, such as size; the unit used,
such as lines of code; and the data scale: nominal, ordinal, interval, or ratio. Units are valid only
for interval or ratio data, but they can be adapted for use with ordinal data. In order for a value
to have any meaning, the entity, the attribute being measured, and the units must be specified.
The measure must be defined over a specified set of permissible values.
In order to be valid, a measure must have:
• Attribute validity: The entity being analyzed has the attribute.
• Unit validity: The unit is appropriate for the attribute.
• Instrumental validity: The underlying model is valid and the instrument was calibrated.
• Protocol validity: The protocol used for the measurement was valid and prevented errors
such as double-counting .
Furthermore, in order to be theoretically valid, a direct measure must have the following
properties:
• The attribute has different values for different entities.
• The measure works in a way that makes sense with respect to the attribute and its values
for different entities.
• Any of the attribute’s units can be used if the attribute is part of a valid measure.
• The attribute can have the same value for different entities.
For an indirect measure, the following properties apply:
• A model of relationships among entities’ attributes is the basis for the measure.
• No improper use of dimensionality occurs in the measure.
• No unexpected discontinuities occur in the measure.
• The units used are appropriate for the scale of data available.
These criteria were proposed to apply specifically to complexity metrics, but some of them are
more generally applicable. Of these rejected most but incorporated properties 1, 3, and 4 into
their framework. These properties are:
1. There exist different entities with different values.
2. There exist different entities with the same values.
3. There exist entities that perform the same function in different ways and have different
values also proposed a set of criteria for metrics. Included in their criteria are some specific
properties that cohesion metrics should have. These properties are:
• Non-negativity and normalization: The value falls in a defined range [0, max]
• Null value: The value is zero if there are no relations within a module
• Monotonicity: Adding relations within a module never decreases the value
• Cohesive modules: The module created by merging two unrelated modules has a
value less than or equal to the cohesion value of the more cohesive original module.
194 LOVELY PROFESSIONAL UNIVERSITY