Back to the 2019 paper

Module 3: Software Design & Metrics

201914m

Give four major types of software metrics using specific examples. Also, explain how object-oriented design metrics might be used to perform the quantitative assessment of software quality.

Worked SolutionAI Assisted

Software Metrics and Object-Oriented Design Metrics

1. Major types of software metrics

Software metrics are quantitative measures used to understand and control software products, processes and projects. Four useful categories are:

Type What it measures Example
Product metrics Characteristics of the software product LOC, defect density, complexity
Process metrics Effectiveness of the development/maintenance process Defect removal efficiency, review effectiveness
Project metrics Project progress and management Effort, cost, schedule variance
Quality metrics Quality attributes of the delivered software Reliability, maintainability, usability, failure rate

2. Object-oriented design metrics

Object-oriented metrics quantify properties of classes, inheritance, coupling and cohesion. A well-known set is the CK (Chidamber–Kemerer) metric suite.

Important examples:

  • WMC — Weighted Methods per Class: measures the number/complexity of methods in a class.
  • DIT — Depth of Inheritance Tree: measures how deep a class is in the inheritance hierarchy.
  • NOC — Number of Children: counts immediate subclasses of a class.
  • CBO — Coupling Between Object classes: measures coupling between classes.
  • RFC — Response for a Class: counts methods that can potentially execute in response to a message to the class.
  • LCOM — Lack of Cohesion of Methods: indicates how unrelated the methods of a class are.

3. Quantitative assessment of quality

These metrics can be collected across versions and compared with thresholds or historical baselines.

For example:

  • High CBO may indicate excessive coupling and lower maintainability.
  • High LCOM may indicate poor class cohesion.
  • Very high WMC may indicate a class that is difficult to understand or test.
  • Large DIT can increase reuse but may also make behavior harder to understand.
  • High NOC can indicate significant reuse of a superclass, but changes to the superclass may affect many subclasses.

Thus, object-oriented design metrics turn design characteristics into measurable indicators that can support quantitative quality assessment and identify classes needing refactoring or review.

Similar questions