知识卡片
契约测试验证双方交互
契约测试把消费者会发出的请求与生产者承诺返回的响应写成可执行交互。生产者核对实现是否满足契约,消费者可对照同一契约验证调用与解析方式;双方不必等所有依赖都部署后才发现接口不一致。契约只约定交互,业务过程仍需其他测试。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
A contract is a definition of an interaction between the consumer and producer. It is a statement to say if a consumer makes a request that matches the contract request definition, then the producer will return a response that matches the contract response definition.
参考来源
- 位置:《Mastering API Architecture》第2章《Testing APIs》之《Contract Testing》(源文件:_epub-src/OEBPS/ch02.xhtml)
- 结论依据:原文把契约定义为消费者请求与生产者响应的共同约定,并说明它可生成生产者测试和消费者使用的 stub。
- 原始内容:A contract is a definition of an interaction between the consumer and producer. It is a statement to say if a consumer makes a request that matches the contract request definition, then the producer will return a response that matches the contract response definition.