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

150 integration testing scenarios for gmail

12001


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..

15614


What is explain security testing?

704


How to generate test cases for 'replace a string' method?

900


consider a program module that inputs two (2) values, n and max, and computes the sum of the first n integers as long as this sum is less than max; otherwise an error should be reported. if n is negative, then it takes the absolute value. a) list the equivalence partitions, and b) list the boundary values.

1776






What is use case testing?

699


How to write test case for this scenario. If the Zip Code field is populated, the system shall compare  the zip code value entered to the zip code value in  the Family Individual Information Tab

8500


If I wrote test cases for Login Window with test case Name Login window & test case id L_01.Now if Name of Login window get changed in the next version.then May I have to change the Test case name & Test case id OR HAVE TO block the previous test case and write the new one

1937


Explain the functional testing?

651


Explain the gray box testing?

714


If for any software product, if the customers more often us few functions, and rarely use few othere functionality. what a tester can expect more deffects can be found, in what area, where the functionality frequently used OR where rarly used?

1722


Test a file replication service that copies files from one net location to another

2041


How to write test cases for "open file dialog box" for ms word? Thanks a lot!

3532


This was asked to me recently in Microsoft interview How would you do DOS copy command testing

1903


How to write the test cases for STP

5089