Design Metrics

Recall that the Modularity Principle states that systems should be built out of cohesive, loosely coupled modules (classes and packages).

In these lectures we develop metrics that can be used to measure the cohesiveness of a class and the degree of looseness of coupling between two classes.

We can also develop meta-programs that compute cohesiveness and coupling degree of all classes in a target program, thus providing a rough quantitative measure of the target's design quality.

(Although some people take these metrics seriously, the purpose of introducing them here is to build intuition regarding the concepts of cohesion and coupling.)

Measuring Cohesion

Cohesion

Measuring (lack of) Cohesion

Measuring Coupling

Dependency Graphs

Responsibility and Stability

Coupling Degree

Encumbrance