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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / dmitry
Correct Answer is "B"
b) 1 test for statement coverage, 2 for branch coverage
1) Statement coverage - 1 test.
P must be > than 50
P+Q must be > than 100
All statements (8 rows) are covered (used).
2) Decision coverage - 2 tests
2.1 P must be > than 50
P+Q must be > than 100
All "TRUE"(YES) decisions (1 and 2) are covered
2.1 P must be < than 50
P+Q must be < than 100
All "FALSE"(NO) decisions (1 and 2) are covered
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / jyoti
Yeah , answer in D , since two question have been asked ,
and 2 branches we are covering , since statement coverage is
class, and Branch coverage that we are covering all if
statement and there are two if's
Please let me know if anybody finds this is wrong
| Is This Answer Correct ? | 2 Yes | 7 No |
Answer / nayana
a) 1 test for statement coverage, 3 for branch coverage
Since inputs are not specified the above answer is
correct
If inputs are given then apply the given inputs in the
given code & then check it & to confirm u can draw the flow
diagram & check it.
For example u can apply p = 70 & q = 40
For the above inputs, (a) is correct answer
| Is This Answer Correct ? | 9 Yes | 15 No |
Answer / vaishali
it wud be 2 testcasese for statement coverage and 2 for
branch coverage
2 for statement coverage bcaz two seperate questions being
asked
p+q>100 and p>50
and its two branches with NO hasnt been covered....
so, answer is 2 testcasese for statement coverage and 2 for
branch coverage
| Is This Answer Correct ? | 3 Yes | 13 No |
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)
1. What is Validation and Verification? 2. What is Severity and Priority? Give an examples for: Severity High and Priority High Severity High and Priority low Severity low and Priority high Severity low and Priority low 3. What is Test Metrics? 4. What is Traceabily Matrix? 5. What is CAR in Cheque Remittance Project? 6.What are the tabs in the latest version of Test Director? 7.Explain Development "V" Model? 8.What will you do first when you are asked to start testing? 9.What will you do if you find a bug first time? Can i directly report to the developer? 10.Can you connect Load Runner to Test Director?
What should you do if you don`t have sufficient document,how do you go and work in that environment.
What is TEST PLAN, TEST STRATEGY, TEST SCENARIO, TEST CASE, TEST SCRIPT? can any body give me definition with example.
Testing Methodologies
How the application is launched to the production environment?
what is the difference between quality control and quality assurance?
can you please tell me what is test script ..with example what is the difference between test script and test cases
my mail id is mudaseer20@gmail.com if i type email id as MudAseEr20@gmail.com and password correctly then what is the output?does it display inbox page
What are the limitations for testing?
4 Answers Thatavarti Technologies,
If there are Requirements document, we can use traceability matrix to find the test coverage. How to get the test coverage if there are no requirements.
What did your base your test cases?