知识卡片

普通读书笔记卡 · 3329.k

一个测试方法聚焦一个场景

理解等级:初级

每个测试用例聚焦一个独立场景,包括失败路径,并维持清晰输入与少量关键断言。把多个场景堆在同一方法中,会增加定位失败原因的时间。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Principles of Software Architecture Modernization》第7章《Proper Service Testing》(源文件:`_epub-src/OPS/ch07.xhtml`,归一化正文 [29321:33498)) - 结论依据:原文的计算器示例隔离了求和、正常除法与除零测试,并提出一方法一场景。 - 原始内容:One method per test scenario is a best practice. Testing manifesto Figure 7.5: Testing Manifesto Source: https://www.growingagile.co.za/2015/04/the-testing-manifesto/ Before we go further, let’s introduce the testing manifesto, introduced by Growing Agile in 2013. 79 The principles of the Testing Manifesto help focus teams on the right mindset, values, and principles to support proper quality and testing practices in agile teams and even to some degree, software design.