知识卡片
契约测试保护服务消费者
服务发布前用契约测试验证消费者依赖的接口仍可用。可先用本地假实现获得快速反馈,再按需要以有限真实依赖做远程验证,避免把契约测试膨胀成全链路测试。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第7章《Proper Service Testing》(源文件:`_epub-src/OPS/ch07.xhtml`,归一化正文 [33498:37732))
- 结论依据:原文把契约测试用于判定是否破坏消费者,区分本地与远程形式。
- 原始内容:Contract tests tell you if your changes will break consumers - this is very important for services. Contract testing also provides a form of documentation on how to call your service. Contract tests come in two forms, local contract tests that heavily use fakes and mocks, and remote contract tests.