GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Testing  >  Whitebox Testing

 Print  |  
Question:  How to calculate Branch and statement coverage for these?

Answer: Switch PC on
Start “outlook”
IF outlook appears THEN
Send an email
Close outlook

a) 1 test for statement coverage, 1 for branch coverage
b) 1 test for statement coverage, 2 for branch coverage
c) 1 test for statement coverage. 3 for branch coverage
d) 2 tests for statement coverage, 2 for branch coverage
e) 2 tests for statement coverage, 3 for branch coverage

IF A > B THEN
C = A – B
ELSE
C = A + B
ENDIF
Read D
IF C = D Then
Print “Error”
ENDIF

a) 1 test for statement coverage, 3 for branch coverage
b) 2 tests for statement coverage, 2 for branch coverage
c) 2 tests for statement coverage. 3 for branch coverage
d) 3 tests for statement coverage, 3 for branch coverage
e) 3 tests for statement coverage, 2 for branch coverage



July 07, 2009 05:41:16 #4
 maguschen   Member Since: July 2009    Total Comments: 2 

RE: How to calculate Branch and statement coverage for these?
 

Question first:
b) 1 test for statement coverage, 2 for branch coverage

a) Outlook appears == True, fulfill the statement coverage
b) Outlook appears ==
True and outlook appears == False fulfill the branch coverage

Question second:
b) 2 tests for statement coverage, 2 for branch coverage

Test data should be:
a) A>B, C==D
b) A

     

 

Back To Question