← 返回刚才阅读的位置

知识卡片

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

测试边界由可调用职责形成

理解等级:中级

巨型脚本或notebook混合I/O与逻辑时难以建立输入输出断言。可逐步提取有清楚责任的函数,再保护与重构;不是为了测试随意暴露所有私有实现或拆成无意义小函数。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      you want to start writing your own unit tests. However, you may be looking at a codebase that looks incredibly difficult to test. For example, imagine if all of the code is in a very long Python script or notebook, with no callable functions—this makes it hard to test because we don’t even have a function to invoke, much less a result to assert on.

    参考来源

    - 位置:《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) - 结论依据:摘录中关于测试边界由可调用职责形成的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:you want to start writing your own unit tests. However, you may be looking at a codebase that looks incredibly difficult to test. For example, imagine if all of the code is in a very long Python script or notebook, with no callable functions—this makes it hard to test because we don’t even have a function to invoke, much less a result to assert on.