← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 3231.b

端到端载荷应代表真实使用

理解等级:中级

端到端用例的请求载荷要接近消费者真实使用,包括常见的大请求和关键字段组合。若测试只用很短的示例请求,就可能漏掉缓冲区不足等仅在实际规模下出现的问题。选择样本时可从真实调用分布提取代表性尺寸,再验证完整链路。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      When writing your end-to-end tests, you should use realistic payloads. We have seen cases where tests use small and concise payloads, then when investigating why APIs are breaking it is found that the consumers are regularly sending very large payloads—larger than the buffers support. This is why your end-to-end testing needs to be representative of the way that a consumer uses your API.

    参考来源

    - 位置:《Mastering API Architecture》第2章《Testing APIs》之《Automating End-to-End Validation》(源文件:_epub-src/OEBPS/ch02.xhtml) - 结论依据:原文举出测试载荷过小、消费者经常发送超出缓冲区的大请求,因而要求测试代表消费者使用方式。 - 原始内容:When writing your end-to-end tests, you should use realistic payloads. We have seen cases where tests use small and concise payloads, then when investigating why APIs are breaking it is found that the consumers are regularly sending very large payloads—larger than the buffers support. This is why your end-to-end testing needs to be representative of the way that a consumer uses your API.