For the following piece of code, how many test cases are needed to get 100% statement coverage?

Procedure X

Read (Color) // Input color from user

IF (Color == “Red”) THEN

Call Roses(Color)

ELSEIF (Color == “Blue”) THEN

Call Violets(Color)

ELSE

PRINT “User is no Shakespeare”

SaveToDatabase(Color)

End Procedure X

A. 5

B. 3

C. 1

D. 2






Answer / toshimathur

B

Is This Answer Correct ?    0 Yes 0 No

Post New Answer




More Test Cases Interview Questions

How to write test cases on for Logging management?

4 Answers   TCS, ABC,


what are those parameters or matrixes for tesing a software user interface?

2 Answers  


what are test repository???? need for test repository/need for maintaining test cases?? advantages and disadvantages for maintaining test case??

2 Answers  


hai im finished software testing course im technicaly strong but yet now no opportunities come to me.if any opportunities please send to my mail id my mail di is sumathi11685@gmail.com

0 Answers  


Given the following code, which is true about the minimum number of test cases required for full statement and branch coverage: Read P Read Q IF P+Q > 100 THEN Print "Large" ENDIF If P > 50 THEN Print "P Large" ENDIF A. 1 test for statement coverage, 3 for branch coverage B. 1 test for statement coverage, 2 for branch coverage C. 1 test for statement coverage, 1 for branch coverage D. 2 tests for statement coverage, 3 for branch coverage E. 2 tests for statement coverage, 2 for branch coverage

1 Answers   ISTQB,


Disc = 0 Order-qty = 0 Read Order-qty If Order-qty >=20 then Disc = 0.05 If Order-qty >=100 then Disc =0.1 End if End if A. Statement coverage is 4 B. Statement coverage is 1 C. Statement coverage is 3 D. Statement Coverage is 2

1 Answers   ISTQB,


i m a fresher working in healthcare industry. here we hve no tool for testing. how i ll do manual testing?plz suggest anyone me urgently... i knw to write test case bt i dont knw where to write n how to execute it manually

2 Answers   Cognizant,


What is the Difference between Testing Types and Testing Techniques

4 Answers   ISTQB,


write a test cases for advanced search

1 Answers   Satyam,


Pls can any 1 temme the test cases for an online banking proj. like account transaction summary, deposit module, savings module

1 Answers  


how many test cases u write in day while testing yr application.and wat z ur role after u finished testing application plz do reply

9 Answers  


can anybody tell me that how many days required to complete 1000 test cases.And what would be the avg testcase perday for a tester.

2 Answers  




Categories