什么是抽象与不稳定性图? [英] What is Abstractness vs. Instability Graph?

查看:34
本文介绍了什么是抽象与不稳定性图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近使用了 NDepend,它生成了关于我的 .net 程序集和相关 pdb 的很好的报告.

我在报告中发现的最有趣的事情是抽象性与不稳定性图.我想真正详细地了解这一点,我阅读了他们的文档和在线指标,但这只能在一定程度上有所帮助.

我主要想了解如何正确评估图形以及如何稳定地控制抽象性.

有一篇非常好的文章更定量地描述了这些概念条款.

文章摘录:

一个类别的责任性、独立性和稳定性可以通过计数来衡量与该类别交互的依赖项.已确定三个指标:

Ca : Afferent Couplings : 依赖于该类中类的类外类的数量.

Ce : Efferent Couplings : 该类别内依赖于该类别外的类的数量.

I:不稳定性:(Ce ÷ (Ca+Ce)):该指标的范围为 [0,1].I=0 表示最大稳定的类别.I=1 表示最大不稳定类别.

A:抽象性:(类别中的抽象类数÷类别中的类总数).该度量范围是 [0,1].0 表示具体,1 表示完全抽象.

在任何特别大的软件系统中,平衡是至关重要的.在这种情况下,系统应该在抽象性和稳定性之间取得平衡,才能好".A-I 图上的位置显示了这一点.请阅读文章以获得解释.

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. instability graph. I wanted to understand this in real detail, I read their docs and online metrices but it could only help to an extent.

Primarily I wish to understand how to evaluate the graph correctly and techniques to control abstractness with stability.

There's a very good article here that talks on this but what more in addition to this I need is 'how do I control this ? [controlling abstractness with stability]'

解决方案

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.

这篇关于什么是抽象与不稳定性图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆