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
Hi I want to start online training couses for testing Any body plz help me out how to start the online courses Plz post the answer here or send me a mail for kommineni.1020@gmail.com
What is a defect?
What is grey box testing?
i heard that mainframe testing is diff from other environments & has lot of keyboard input????pl clarify my doubt & let me know in what way its diff??
Why Equivalence Partitioning is called equivalence or what is the significance of equivalence term in ECP?
what is e-tester?
What are the main key components in web applications and client and server applications?
integration test cases for mouse and keyboard
1...DIFF BETWEEN QTP AND WIN RUNNER? 2... CHECKPOINTS AND EXPLAIN EACH OF THEM? 3...WHY IS STEP GENERATOR? 4... WHAT IS THE DIFF BETWEEN FUNCTIONS AND SUB ROUTINE?
Could someone please send me real check list for Database Security testing.Please my mail ID- patil.ramchandra@yahoo.co.in. Thanks.
Please Provide me the link to download Testing Category questions and answers If some body has downloaded it pleae send it to me Pavan : Email pavan_cd@yahoo.com Quetion2 : Can any body Explain me about Testing thumb rules
what r the 5 major defects that u found in ur shopping related project?
what are the typical problems in web testing?
What type of testing you perform in organization while you do system testing, give clearly?
How can you do the scalability testing?