Structure based testing techniques - MCQs1. Given the following sample of pseudo code:
01 Input number of Sandwich
02 Input number of Iced tea
03 If Sandwich > 0 and Iced tea > 0 then
04 Input Do you want home delivery (Yes / No)
05 If home delivery = No?
06 Print Serve their order now
07 End if
08 End If
Which of the following test cases will ensure that statement 6 is executed?
a) Sandwich = 1, Iced tea = 1, home delivery = yes
b) Sandwich = 1, Iced tea = 1, home delivery= no
c) Sandwich= 1, Iced tea = 2, home delivery= yes
d) Sandwich= 1, Iced tea = 0, home delivery = noView Answer / Hide Answer2. If all the statements of code are executed that means every decision is is executed at least once. True or false.
b) FalseView Answer / Hide Answer
3. How many inputs are required for 100% decision coverage?
Comment: 100% statement coverage does not guarantee 100% decision coverage while 100% decision coverage is 100% statement coverage.
IF A+B > 100 THEN
Print "A+B is Large"
If A > 50 THEN
Print "A Large"
d) 4 View Answer / Hide Answer4. How many inputs are required for 100% statement coverage?
If age < 18 then
Print Reject customer
Print accept customer
d) 4 View Answer / Hide Answer 5. Read A,B
For the above algorithm what will be the minimum number of test cases required to achieve 100% statement and decision coverage?
d) SC=3,DC=3View Answer / Hide Answer6. What is Cyclomatic complexity?
a) Black box testing
b) White box testing
c) Grey box testing
d) Combination of allView Answer / Hide Answer
7. Which of the following is/are structural testing technique?
Comment: Cyclomatic complexity gives the minimum number of paths that can generate all possible paths through the module. As it requires knowledge of internal logic it is white box testing.
a) Statement Coverage
b) Decision Coverage
c) Condition Coverage
d) Path Coverage
e) All of theseView Answer / Hide Answer