知识卡片

普通读书笔记卡 · 3520.a

策略组合构造复杂载荷

理解等级:中级

生成策略可从基础值类型出发,逐层组合为字典、列表和完整请求载荷。组合时应覆盖枚举合法值、非法值、缺省值及边界条件;否则自动生成只是在有限输入空间内重复抽样。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Microservice APIs》第 12 章《Testing and validating APIs》(源文件:_epub-src/OEBPS/Text/12.htm) - 结论依据:原文用 Hypothesis 的标量、字典和列表策略构造订单请求。 - 原始内容:Hypothesis uses the concept of strategy to generate test data. For example, if we want to generate random integers, we use Hypothesis’s integers() strategy , and if we want to generate text data, we use Hypothesis’s text() strategy .