1Q:The following function divides a by b and out put to c,returns -1 as error.
Int divide (int a,int b,int c)
List you test cases in a black-box testing.1问:对 Int divide (int a,int b,int c)函数写出黑盒测试用例2Q:Int a ctivity(int nage,bool bmale)
{if (nage<60)
return zoo;
else if(bmale)
return golf;
else return movie;
}
用cyclomatic complexity,共有多少条路径3Q:The following function tests whether the three numbers can be the lengths of the three sides of a triangle.
Bool triangle(float a,float b,float c)
List you test cases in a black-box testing.
3问:也是让写黑盒测试用例,是一个三个数是否是三角形的三条边的测试
1Q,2、4;2,3;15 4都行
2Q,3条啊
3Q,3,4,5;4,5,6;2,4,6;1,2,3;
Int divide (int a,int b,int c)这个c是传值的,能够返回结果吗?改成指针或者引用吧。
测试么,除了正常数据,考虑错误就是b=0的情况。Int a ctivity(int nage,bool bmale)更看不懂这是什么写法,a是什么?路径应该是4条,除了if中的,还有默认的。也就是说,一般还要加上一个return语句。第3个,在平面上随意取三个点,排除不是三角形的情况,计算相互的距离作为参数传入,结果应该为true;改变任一个参数,结果应该为false。