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 / suyash

The answer is B.
Statement Coverage (SC):
To calculate Statement Coverage, find out the shortest
number of paths following
which all the nodes will be covered. Here by traversing
through path 1A-2C-3D-E-4G-5H all
the nodes are covered. So by traveling through only one path
all the nodes 12345 are covered,
so the Statement coverage in this case is 1.
Branch Coverage (BC):
To calculate Branch Coverage, find out the minimum number of
paths which will
ensure covering of all the edges. In this case there is no
single path which will ensure coverage
of all the edges at one go. By following paths
1A-2C-3D-E-4G-5H, maximum numbers of
edges (A, C, D, E, G and H) are covered but edges B and F
are left. To covers these edges we can follow 1A-2B-E-4F. By
the combining the above two paths we can ensure of traveling
through all the paths. Hence Branch Coverage is 2. The aim
is to cover all possible true/false
decisions.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the cases why parameterization is necessary when load testing the Web server and the database server?

1958


How to integrate Bugzilla with QTP?

2554


Which model is following in your company for developing software?

913


How do you know the code has met specifications?

986


aplitue questions will be based on wich type ?

2333


What is remedy testing,expalim that and how can use that

1504


Write UI Test case, Integration Test case, Functional Test case & Performance Test case for the File Menu for MS-Word?

2341


through which phases a software ttester need to pass like as a junnior test engineer,team lead,project lead,etc.? which is the final stage of your promotion and how will u achieve?

1905


Test approach to windows scheduler?

1885


hai friends i need a general test cases for check box,drop down button and radio butoon can anybody reply me plz..........thanks in advance

1818


write test case for gmail sign up page ?

1798


What is Independant Testing? When and where this type of testing will be performed?

1785


what is the challenging position faced in the testing not in point of management point of view it must be in the point of while testing the application?

4466


What is the difference between load and stress testing?

971


What is smoke test? Do you use any automation tool for smoke testing?

894