针对下列程序段,需要______个测试用例才可以满足语句覆盖的要求。
Switch(value)
{
Case 0:
0ther=30;
Break;
Case 1:
ther=50;
Break;
Case 2:
ther=300;
Case 3:
ther=other/value;
Break;
Default:
ther=other * value;
}
A) 2
B) 3
C) 4
D) 5
A.
B.
C.
D.
第1题:
● 针对下列程序段,需要(58)个测试用例可以满足分支覆盖的要求。
int IsLeap(int year)
{
if ( year % 4 == 0 )
{
if ( ( year % 100 == 0 )
{
if ( year % 400 == 0 )
leap = 1;
else
leap = 0;
}
else
leap = 1;
}
else
leap = 0;
return leap;
}
(58)
A.3
B.4
C.6
D.7
第2题:
第3题:
1、针对下列程序段,需要()个测试用例才可以满足语句覆盖的要求。 switch (value ) { case 0: other = 30; break; case 1: other = 50; break; case 2: other = 300; case 3: other = other/value; break; default: other = other * value; }
A.2
B.3
C.4
D.5
第4题:
第5题: