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 is the difference between Sleep and wait in winrunner what is integration testing and types of testing present what is system testing what is data driven testing what is functionality testing if requirements are given to you then how do you write the test cases for it Account number = Ok cancel For above given form the valid account number starts from 1 to 1000 so is it necessary to input the 1,2,3 ….998,999,1000 test cases to check the conditions of valid account numbers I,e is it compulsory to write 1000 test cases for the above form

2430


What are the various techniques in black box testing?

924


when database testing comes into manual tesing

1990


we are about to implement a Test tool to test the performance of website, so what script does a tester should know (friends plz help me)

1775


How much the bug is affecting the functionality of the application?

870


What ishigh severity, low priority bug?

902


Inwhat basis the time is allocated for testing the application?

1634


What is Test methodology, Testing type , Testing approach, Testing technique & Testing methods. Explain with example.

1734


what is fusion testing and impact analysis???

1989


how mapp the defect id in quality center?

1916


Explain the advantages of automation over manual testing?

915


I know functional test cases are derived from frs and system design specs. But are test cases for performance, database, boundary, relational integrity and other types of tests other than functional tests created from frs and system design specs as well? When are these test cases created? Are they in the same test plans alongside functional test cases or is their a different test plan that includes these test cases?

1987


What is a ‘test plan’?

957


How to do integration testing on duster......

1484


How to do security implementation for any URL??

1670