知识卡片

普通读书笔记卡 · 8756.c · 生成模型:GPT-6

断言完整性取决于业务契约

理解等级:中级

对稳定输出整体比较可防止漏掉字段、错值或额外变化,非确定字段则用明确约束。一个大断言未必比多条断言更全面,要检查匹配器是否允许额外键及每个必要性质是否实际被验证。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      Specific and holistic assertions To illustrate these ingredients, let’s take a look at a positive and a negative example of a test. We’ll show more sophisticated tests in the next section, but for now a simple example will help us focus on the characteristics of a good test: # good example def test_convert_keys_to_snake_case_for_keys_with_spaces_or_punctuation(): # arrange (provide input conditions) user_details = {"Job Description": "Wizard", "Work_Address": "Hogwarts

    参考来源

    - 位置:《Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)》第05章《软件自动化测试》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)/_epub-src/OEBPS/ch05.html) - 结论依据:摘录中关于断言完整性取决于业务契约的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:Specific and holistic assertions To illustrate these ingredients, let’s take a look at a positive and a negative example of a test. We’ll show more sophisticated tests in the next section, but for now a simple example will help us focus on the characteristics of a good test: # good example def test_convert_keys_to_snake_case_for_keys_with_spaces_or_punctuation(): # arrange (provide input conditions) user_details = {"Job Description": "Wizard", "Work_Address": "Hogwarts