Can u any 1 please explain the below question and answer?
Given the following code, which statement 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, 2 for branch coverage

Answer Posted / dmitry

Correct Answer is "B"

b) 1 test for statement coverage, 2 for branch coverage

1) Statement coverage - 1 test.

P must be > than 50
P+Q must be > than 100

All statements (8 rows) are covered (used).

2) Decision coverage - 2 tests

2.1 P must be > than 50
P+Q must be > than 100

All "TRUE"(YES) decisions (1 and 2) are covered

2.1 P must be < than 50
P+Q must be < than 100

All "FALSE"(NO) decisions (1 and 2) are covered

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

HI, This question is Investment Banking domain related Question. I was asked in an Interview to tell the 5 test cases for Equity,Bond,Futures and options. Please help.. Pragya

3879


What is data flow diagram?

668


hi friends i recently finished testing course in hyderabad.now am looking for a job in uk.i need help about the projects in interview point.can any one explain me abt banking project or credit card.like what are the problems faced in u r last project etc.

1409


How do i write a test condition to test the following simple program with the intention of 100% statement coverage Print “Hello World” If Date $ = ‘01-01-2000’ then Print “Happy New Year” END IF PRINT “The date is = “Date $ PRINT “The time is = “Time $ END Could anyone please clarify in detail. Would really appreciate it....

1635


Why testers wil prepare useracceptance testcases,system testcases and integration testcases,What is the differenece between all this test cases

1609






I have 2 yrs 10 months experience in manual testing. there is a gap of 3 yrs in between. just 3 months before i rejoined the same company. I am looking for new & better job.What I have to enhance my career to up level, should I have to do Automation course or any other. Guide me properly.

1451


HI, I WANT TO DO A ISTQB FOUNDATION CERTIFICATION FROM HYDERABAD WHICH INSTITUTE WOULD BE GOOD FOR ME,WHERE I CAN TAKE SOME TRAINING SESSIONS FOR CLEARING THIS EXAMINATION.

1783


how to access a build & wat is its configuration

1763


What is mean by incident logging system ?

2030


need answer interviewer will ask me about all project which i mention in resume or presently i'm working??please reply tomorrow is my interview

1628


What is a test log?

642


write test case for gmail sign up page?

3233


Could some one tell me test cases for multi line text boxes like Notes field?

1698


How do u determine,what to be tested?

1616


send the senario template

1492