Abstraction (A)

 

Overview

The Abstraction metric measures a package's abstraction rate.  The package's abstraction level corresponds to its stability level.

 

Calculations are carried out on classes defined directly in the package, but also on classes defined in sub-packages or sub-classes.  For a project, the metric is, therefore, calculated on all the project's classes.

 

The Abstraction metric provides a percentage (between 0% and 100%), where the package contains at least one class and at least one operation in an abstract class.

 

 

Computation

 


 

The ... variable

represents the …

Nma

number of abstract operations in all the package's classes

Nmca

number of operations (abstract or not) in the package's abstract classes

Nca

number of abstract classes

Nc

number of classes (abstract or not) of the package

 

 

Nominal range

Nominal values cannot be given, since abstraction depends on what the package does (please seen the "Analysis" paragraph in this section).

 

 

Analysis

According to how prone the package is to modification during the application's life cycle, it must be abstract to a greater or lesser extent.  The more stable a package must be, the more abstract it must be, if it is to be extensible.  Abstract packages that are extensible provide greater model flexibility.

 

This means that abstraction and instability must be jointly interpreted.  This is synthesized by the Abstraction/Instability balancing metric, Distance from the Main Sequence (DMS).