Software Architecture - Cohesion

Up
Background
Categories
Classification

Classification

A modules level of cohesion is determined by how well the elements of the module are focused on a single objective.  To evaluate the cohesion of a module the individual doing the evaluation must have a description of the module being evaluated.

Analysis of Purpose

Grammatical

If the sentence describing the module is a compound sentence, contains a comma or contains more than one verb, the module is probably performing more than one function. 

More than one verb connected by or’s probably logical. 
More than one verb connected by and’s probably temporal, procedural, etc., but not functional

If the sentence contains words relating to time, such as first, next, then, after, when, and start, then the module is probably has procedural strength.

 If the predicate of the sentence doesn’t contain a single specific object following the verb, the module probably has logical strength.  For example:

“edit all data” has logical strength.
“edit source statement” has functional strength.

 Words such as initialize and clean up imply classical strength.

Decision Table

  1 2 3 4 5 6 7 8 9
Difficult to describe the module's function.     Y   N   N   N   N   N   N   N   N 
Module performs more than one function. - Y Y Y Y Y Y Y N
Only one function performed per invocation. - N Y N N N N Y Y
Each function in the module has an entry point.  - N N N N N N Y Y
Module contains a set of related functions. - N Y N N N Y Y Y
Functions are related to the application's procedure. - - N N Y N N N N
All functions use the same data - N Y N N N Y Y Y
Coincidental X X              
Logical     X            
Temporal       X          
Procedural         X        
Communicational           X      
Sequential             X    
Informational               X  
Functional                 X

Metrics

A module that partially exhibits several strengths is classified according to the lower strength.

A ratio of the number of modules with functional Strength to the number of modules is use to determine the quality of the system.  This ratio produces a value from 0 to 1.  A cohesion ratio of one indicates that all the modules have functional cohesion.

A module with informational cohesion could be consider as a collection of modules with functional strength.  Therefore, it may not be a redefinition of the cohesion ratio to use modules with functional and informational strength.

© Carl J. Mueller, 2001.

 This page was last update on  04/18/2001