What is Abstractness vs. Instability Graph?

前端 未结 2 880
离开以前
离开以前 2021-02-18 15:21

I recently used NDepend and it produced a good report on my .net assemblies and related pdbs.

The most interesting thing I found in the report was abstractness vs. insta

2条回答
  •  感情败类
    2021-02-18 15:36

    Abstractness is a measure of the rigidity of a software system. Higher the abstraction, lower the rigidity (or greater the flexibility) and vice versa. If the components of the system depend on abstract classes or interfaces such a system is easier to extend and change than if it depended directly on concrete classes.

    Stability is a measure of tolerance to change as in how well the software system allows changes to it without breaking it. This is determined by analyzing the interdependencies of the components of the system.

    Robert C. Martin's article on OO metrics describes these concepts in more quantitative terms.

    Excerpt from the article:

    The responsibility, independence and stability of a category can be measured by counting the dependencies that interact with that category. Three metrics have been identified:

    Ca : Afferent Couplings : The number of classes outside this category that depend upon classes within this category.

    Ce : Efferent Couplings : The number of classes inside this category that depend upon classes outside this categories.

    I : Instability : (Ce ÷ (Ca+Ce)) : This metric has the range [0,1]. I=0 indicates a maximally stable category. I=1 indicates a maximally instable category.

    A : Abstractness : (# abstract classes in category ÷ total # of classes in category). This metric range is [0,1]. 0 means concrete and 1 means completely abstract.

    In any software system particularly large ones, balance is critical. In this case, a system should balance abstractness with stability in order to be "good". The position on the A-I graph shows this. Please read the article for the explanation.

提交回复
热议问题