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 Posted / toshimathur

B

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write the test scenarios for the following: 1. Searching train. 2. Data encryption and decryption. 3. Single signon. 4. Document printing. 5. Testing EMail. 6. Data authentication.

3010


How does the size of the OPCODE field limit the number of operations? Give an example to support your explanation?

1920


write test cases on file open dialog box in notepad

1163


Why is it that the boundary value analysis provides good test cases?

746


How to write test case for android application,alarm clock,LCD display screen. And after seeting alarm mobile get switch off how to write test case..

15592






What is business validation test case?

662


How to write test cases for manual testing? What are the main syntex for writing test cases for Junit?

2464


In a log in page what will be test procedure, test scenario, test description & test steps?

666


What is quick test professional and what test environment it supports?

672


can one defect be mapped to more than one test script in manual testing

1971


Explain the component testing?

739


If I have to write the test cases for any report & there is date box.then may I have to write only select date or have to write all steps required for selecting date

2046


can anyone send me a copy of a business requirement and test cases attributed to such requirent. thank u

1642


Explain the ad hoc testing?

657


write test cases for hospitality management system

1998