gpt4 book ai didi

testing - 边界值分析 - 何时使用二值或三值?

转载 作者:行者123 更新时间:2023-11-28 21:35:23 25 4
gpt4 key购买 nike

我有几个关于边界值分析的问题,希望有人能帮助我。我正在为基于 ISTQB 规范的大学考试学习这个,目前不是为了现实世界的应用。

首先是 - 您应该假设什么时候使用 BVA 的二值法和三值法?关于何时应该使用其中一个或另一个,是否有任何实际区别,或者它是否取决于所问的具体问题(就考试而言),我只需要知道如何使用两者?是否有默认方法可供使用?

其次,考虑这个可能的问题:

A smart home app measures the average temperature in the house and provides feedback to the occupants for different average temperature ranges:
• Up to 10 C – Icy cool!
• 11 C to 15 C - Chilled out!
• 16 C to 19 C - Cool man!
• 20 C to 22 C –Too warm!
• Above 22 C - Hot and Sweaty!
Apply 3 point BVA to the above temperature ranges. How many test cases would you consider?

The answer that was provided was that:
For 10 - we would test 9, 10, 11.
For 11 - we would test 10 (already tested), 11 (already tested), 12
For 16 - we would test 15, 16, 17
For 20 - we would test 19, 20, 21
For 22 - we would test 21 (already tested), 22, 23
This would result in a a total of 12 test cases.

有人可以向我解释为什么我们要测试第一个分区(10 度)的上边界,而不是其他有效分区的上边界(例如 15,这将导致我们测试 14,15 ,16 或 19 导致测试 18,19,20)。这是因为 10 的边界是该分区内的唯一边界,因为下边界是开放的吗?

接下来,假设边界是:

• 0 C to 10 C – Icy cool!
• 11 C to 15 C - Chilled out!
• 16 C to 19 C - Cool man!
• 20 C to 22 C –Too warm!
• 23 - 40 C - Hot and Sweaty!

测试的值是否会更改为以下值?我们是否仍需要测试第一个分区中的上边界,或者我们现在是否会忽略它,因为我们有一个下边界值?

For the lower invalid partition -2, -1, 0
For the first valid partition: -1, 0, 1
For the second valid partition: 10, 11, 12
For the third valid partition: 15, 16, 17
For the fourth valid partition: 19, 20, 21
For the fifth valid partition: 22, 23, 24
For the upper invalid partition: 40, 41, 42

提前谢谢你 - 我想我已经把我脑子里的事情复杂化了,并且为此绞尽脑汁!

最佳答案

三值边界不是严格要求的。例如。在您的示例中,9 和 10 来自同一个等价类。就个人而言,我要么完全跳过 9,要么 randomize整个分区的值。

在您的“提供的答案”中,“哪些案例与哪个分区相关”的划分是任意的。 11 是 ∞-10 范围的“负”边界还是 11-15 范围的“正”边界?没有正确答案。在实践中,您只需编写这 8 个检查,而无需标记哪个检查用于哪个边界:

* 10     - Icy
* 11, 15 - Chilled out
* 16, 19 - Cool man
* 20, 22 - Too warm
* 23 - Hot and Sweaty

如果您决定使用“三值法”并检查每个范围的非边界值,您将获得额外的 5 个案例,因为有 5 个范围。

有趣的是,您的“提供的答案”是不一致的。每个等价类都检查了非边界值,除了“又热又出汗”——它应该在列表中有 24 个,结果是 13 个案例。

免责声明:这是从业者的回答。我没有读过 ISTQB,所以如果您需要此信息来通过测试(而不是在实践中使用它)- 请谨慎使用。

关于testing - 边界值分析 - 何时使用二值或三值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59346048/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com