Tell me 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

Answer Posted / saurabh_g

Since both the conditions are independent of each other :

(1) Branch Coverage :

2 Test cases are required.

1st test case : When P+Q > 100 is True (1st branch)
2nd test case : When p > 50 is True (2nd Branch)

(2) 100 % Statement coverage : Each executable statement
executed atleast once.

Again 2 Test cases are required.

1st test case : When P+Q > 100 is True
2nd test case : When p > 50 is True

(3) Path coverage :

4 Test cases are required because 4 paths are possible.

1st : When P+Q > 100 is true but P>50 is false
2nd : When both "P+Q > 100" and "P>50" are true.
3rd : When both "P+Q > 100" and "P>50" are false.
4th : When P+Q > 100 is false but P>50 is true.


Cheerz,
Saurabh Garg

Is This Answer Correct ?    4 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Test Case for Text Editor!

2763


1.1 Purpose This tool is also a simple tool, but will be graphics- intensive, and will access the 3 databases (card databases) used in Tarot. 1.2 Scope Only for registered user. 1.3 User Interface - No questions asked, parrot pulls out tarot card - Inside Parrot application, User just have to click on a link saying ""XXXX"" to activate the tool. - Shown is the card of the day, from pack of Tarot cards(78 in number) with fixed graphics, animation, audio. Output: - Graphic-rich display of randomly selected card with detailed meaning, with links to tarot tool. - Graphics: Flying / walking parrot, emerging and choosing a card, displaying the same, and continuing to interact based on card meaning. - The cards also need to carry a brief 1/0 meaning, which will trigger a 1/0 behavior from the parrot (sympathy/making fun/crying or congratulating/smiling/winking)

1467


how to write a test cases for Quick links like Feedback/Suggestions Advertise with us Contribute Invite a Friend FAQs Make HomePage RSS Feed Buzz Words Email Privacy Statement Terms & Conditions Copyright Disclaimer Download Forgot Password

2567


how to write test case for GUI testing and tell me in brief about GUI and all related WEB based testing..if possible then pls give example of its test case...m new in testing........thannx for help in advance

3361


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

3534






How to test Webservices and how can we write test cases for that

2880


How to write the test cases for STP

5096


Who will take care of test plan and test case?

1639


1 Crystal Ball 1.1 Purpose This is a simple tool, for entertainment purposes only. 1.2 Scope Only for registered user. 1.3 User Interface Single page with graphic of crystal ball, and text box for typing question. User has to type her question in text box outside ball. Reports: - On ‘submit’, the system needs to access any one of the pre-stored responses at random and display in a graphical, visually appealing manner in the crystal ball. - Audio / graphical changes need to be built in, for added user experience enhancement, like music, sound effects, visual changes. Need to get details.

1640


What is ramp testing?

661


Explain the component testing?

755


can any body help me with providing a a case for usability testing...

1665


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

5903


test cases for bus transport (TNSTC)

2784


How to write test case for this scenario. The system shall auto populate the Email Address on the contact screen with the Email Address of the user profile 

1644