知识卡片
过滤器插入测试观察点
拦截过滤器把请求响应的前后处理从业务职责移开,按链组合日志、认证或测试观察逻辑,使测试探针不用侵入核心功能。过滤器顺序会影响所观察数据;每层若遍历大输入,会增加延迟和资源消耗,不能无边界叠加。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 可测试性 · 查看原书依据
Testing filters can be inserted in this way, without disturbing any of the other processing in the system. Benefits: • This pattern, like the strategy pattern, makes classes simpler, by not placing all of the pre- and post-processing logic in the class.
参考来源
- 位置:《Software Architecture in Practice, 4th Edition》第12章《可测试性》(来源项目:book-sources;源文件:extracted/Software Architecture in Practice, 4th Edition/_epub-src/ch12.html)
- 结论依据:所引连续原文给出本卡机制或取舍;条件与示例结合本节已读上下文解释。
- 原始内容:Testing filters can be inserted in this way, without disturbing any of the other processing in the system. Benefits: • This pattern, like the strategy pattern, makes classes simpler, by not placing all of the pre- and post-processing logic in the class.