← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 1712.e.2

降低结构与行为复杂度

理解等级:高级

减少循环依赖、外部环境耦合、深继承和难追踪动态调用,可缩小构造与定位状态的空间。类响应数量统计本类方法及其调用的方法,能作为观察指标;高内聚、职责分离也帮助逐层测试。行为上尽量控制无约束并发,无法避免的非确定性再用录制回放等管理,不能只减少代码行数。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 可测试性 · 查看原书依据

      This tactic involves finding all the sources of nondeterminism, such as unconstrained parallelism, and weeding them out to the extent possible. Some sources of nondeterminism are unavoidable—for instance, in multi-threaded systems that respond to unpredictable events—but for such systems, other tactics (such as record/playback) are available to help manage this complexity.

    参考来源

    - 位置:《Software Architecture in Practice, 4th Edition》第12章《可测试性》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch12.html) - 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。 - 原始内容:This tactic involves finding all the sources of nondeterminism, such as unconstrained parallelism, and weeding them out to the extent possible. Some sources of nondeterminism are unavoidable—for instance, in multi-threaded systems that respond to unpredictable events—but for such systems, other tactics (such as record/playback) are available to help manage this complexity.