24小时热门版块排行榜    

查看: 398  |  回复: 4
当前主题已经存档。

p1801321

金虫 (著名写手)

[交流] 重金求翻译

分隔线以上20币,以下10币,谢绝翻译软件,不给币
3.3 Examples
Figure 10 shows a DSM for JUnit version 3.8.1, an open source regression testing framework. This DSM was created by loading the JUnit jar file into LDM and then applying the partitioning algorithm. The DSM shows that JUnit is a layered system with clean separation of the user interface layers from the underlying
core logic.
Figure 11 shows the DSM (created by the same process) for jEdit version 4.2, an open source editor with about 800 classes. Its layering, unlike JUnit’s, is not immediately apparent. The large number of dependencies in column 151 shows that there are a number of classes in the top level package jedit that reference
most of the other subsystems. It also shows that most of the other subsystems also reference these classes. This suggests that a refactoring might be in order to reduce the coupling.
3.4 Design Rules
The distinction between acceptable and unacceptable dependencies is expressed using design rules, which are provided by the user, and applied to the displayed DSM, in order to highlight the dependencies that violate the intended architectural
design. A design rule may require, for example, that a library subsystem has no dependencies on the rest of the application, or that only certain parts of a core subsystem may depend on GUI modules. Continuous checking of design rules, akin to regression testing, can be used to keep a code base in sync with its design.
Architectural creep becomes less of a problem, and flaws (especially those introduced by new team members) are caught as soon as they are introduced.
The very expression of design rules has benefits that go beyond a shared articulation of design intent. When current design rules are violated for good reasons, it forces the revision of design rules thereby making architectural evolution explicit.
-----------------------------------------------------
The DSM itself provides a convenient way to input design rules, by having the user click on cells to identify allowed or forbidden relationships. Design rules exploit the hierarchical structure too, since a rule specified for a subsystem can apply to all its
constituents.
3.4.2 Using a DSM to Represent Design Rules
In LDM, design rules are shown visually (Figure 12) by marking the corners of a cell with green and black to indicate whether a dependency is permitted. For a can-use rule, the cell has a green triangle in the upper left corner; for a cannot-use rule, the cell has a black triangle in the lower left corner. A dependency in a cell governed by a cannot-use rule is a design rule violation, indicated by a red triangle in the upper right corner.
Note that often we turn off the display of the green triangle. This makes the display easier to read by enabling the user to focus on dependencies which are not permitted. In subsequent figures, a triangle in the lower left-hand corner of a cell shows where a dependency is prohibited, except for Figure 18, in which the
triangles highlight violations.

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

syh9288

捐助贵宾 (著名写手)

海军上将

★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★ ★
p1801321(金币+30,VIP+0):辛苦了,非常感谢 12-11 10:56
看来还是要我翻译喽
人生如梦,一樽还酹江月
2楼2009-12-11 09:21:49
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

syh9288

捐助贵宾 (著名写手)

海军上将

例3
  图10表示的是JUnit 3.8.1版本的设计性矩阵(DSM)----一种开放源码的回归测试框架。这种DSM的创立是通过这两步完成的,首先下载JUnit的jar格式文件到LDM中,然后运用到分区算法。DSM表明JUnit是一种分层系统,而且用户界面层与底层核心逻辑完全隔离。
  图11表示的是jEdit version 4.2DSM(同一过程创立的,同上)------一个开放源码编辑器,它有着800类别。不像JUnit分层,它的分层不是很直接表面上就能看清楚的。大量的151列中的链接表明在最高水平的打包编辑器(这种编辑器与大部分其他子系统存在引用的关系)中有相当大的类别。它还表明:重构可能是为了减少联接。
人生如梦,一樽还酹江月
3楼2009-12-11 09:47:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

syh9288

捐助贵宾 (著名写手)

海军上将

3.4设计规则
  可接受的和不可接受的链接之间的区分是通过用户提供的设计规则来表达的,为了突出那些与预期的设计规则不相适应的链接,我们将这种区分技术应用于显示的DSM。
  例如,设计规则可能有这些要求:一个程序库的子系统不依赖于其他应用程序,或者,只有核心子系统的某些部分可以与GUI(图形用户接口模块)有联系。设计规则的连续性检查,类似于回归测试,可用来保持一个代码库与其设计同步。
  结构的渐变不再是问题,只要这些缺陷被引入,他们(特别是那些被新团队成员引入的)会很很快被发现。
  一种设计规则恰到好处的表达会超越一种通用的设计意图表达,这可以带了很多的好处。当现在的设计规则没有充分的理由证明其合理性,这将迫使我们修改设计规则从而使得架构演变的过程更明晰。
  ————————————————————————————————————————————————————
人生如梦,一樽还酹江月
4楼2009-12-11 10:19:20
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

syh9288

捐助贵宾 (著名写手)

海军上将

通过让用户点击单元格来识别允许或禁止的关系,DSM本身就能为输入设计规则提供了一个便捷的途径。设计规则利用层次的设计结构,由于指定的子系统的规则可以适用于所有它的
组分。
  3.4.2用DSM去表示设计规则
  如图12所示,LDM设计规则是通过将单元格的边角标记为绿色或者黑色来表示的,这种颜色上的区别暗示着链接是否是被允许的。对于can-use规则,单元格左上角是绿色的三角形,对于cannot-use规则,单元格左下角有是黑色三角形。单元格中受cannot-use规则支配的链接是与设计规则不相适应的,右上角会用红色三角形表示。
  注意,我们常常隐去标有绿色三角形的单元格,这种更清楚的显示让使用者能将注意力集中到不被容许的链接。在接下来的图中,单元格左下角有三角形的标记表明链接是禁阻的,除了图18,图18中三角形突出的是违反了设计规则。
人生如梦,一樽还酹江月
5楼2009-12-11 10:48:59
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 p1801321 的主题更新
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见