、软件测试阶段白盒测试,以如下程序为例,画出其程序流程图,并给出至少四种逻辑覆盖标准的测试用例。“ int a,b;e double c;e if(a>0 && b>0) c=c/a代 if(a>1/c>1)( c++ c+=b代
时间: 2024-03-22 09:37:55 浏览: 53
白盒测试:使用逻辑覆盖方法实例
以下是程序的流程图:
```
+---------+
| Start |
+---------+
|
|
| a > 0 && b > 0
|
+---------+
| Step 1 |
+---------+
|
|
| c = c / a
|
+---------+
| End |
+---------+
|
|
|
| a > 1/c > 1
|
+---------+
| Step 2 |
+---------+
|
|
| c++
|
|
| c += b
|
+---------+
| End |
+---------+
```
四种逻辑覆盖标准的测试用例如下:
1. a > 0 && b > 0,a = 5,b = 7,c = 2.0
2. a > 0 && b > 0,a = -3,b = 2,c = 5.0
3. a <= 0 || b <= 0
4. a > 1/c > 1,a = 2,b = 3,c = 0.5
阅读全文