Class LCOM96b

LCOM96b (Lack of Cohesion of Methods, Handerson et al., 1996)

Formula: LCOM96b = (1/a) * Σ((1/m) * (m - μ(A))) for all attributes A

Where:

  • m is the number of methods in the class
  • a is the number of attributes (fields) in the class
  • μ(A) is the number of methods that access an attribute (field) A
  • The formula measures how methods are connected through attributes

Returns a value between 0 and 1:

  • 0: perfect cohesion (all methods access all attributes)
  • 1: complete lack of cohesion (each method accesses its own attribute)

Implements

Constructors

Properties

Methods

Constructors

Properties

name: string = 'LCOM96b'
description: string = 'Lack of Cohesion of Methods (Handerson et al., 1996) - Ranges from 0 (high cohesion) to 1 (low cohesion)'

Methods