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 Dear this urgent for me i have need of ROLTA India Ltd Mumbai Paper pattern for Testing Person , PLease Help me , if any body have any idea about it
What is bottom-up approach?
Write the 10 high test cases for making video call/face time?? Write the test cases for credit card accessing the money transfer?? Write the test cases for file transfer from one user to other from Google Drive/drop box?
how to write the test cases for mark as read/unread mails for gmail inbox?and what are the testings we will do?
What are the different servers and difference between them?
what is independent question and what is retriewing and what is problem of severity.
Explain test metric and the information it provides.
How do u prepare test environment for ur application?
hi sir, i completed my GNIIT from NIIT. i recently joined in IT company for Testing(manual) on JD EDWARDS.So,i wanna to ask that after taking 1yr experience can i able to do Testing .NET in another company.Pl i am confused pl send yours suggestion throw my email(paresh_shindeal@yahoo.com)
What is difference between web site testing, desktop application testing and wireless application testing? what is the difference in testing strategy to test them?
anybody there with 3+ exp in software testing looking for change and like to work in bangalore fwd your resume to vinodhanandhan@gmail.com
My name is Akpos from Nigeria. I have finished manual testing course. Please, can someone advise me where to go on from here?
what are questions asked in TCS for database tester (sqlserver)?ay idea
What is the difference between three tier and two tier application?
what are the testing appraoch that you have tested for Bread toaster