Tell me 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
Answers were Sorted based on User's Feedback
Answer / santosh kumar singh
take p=70
and q=40
with this the full statement coverage
for the else part for branching
2 test cases for branches coverage.
take p=40
and q is same as above
with this the else part of both the block will be covered.
Santosh kumar Singh.
| Is This Answer Correct ? | 9 Yes | 2 No |
Since both the conditions are independent of each other :
(1) Branch Coverage :
2 Test cases are required.
1st test case : When P+Q > 100 is True (1st branch)
2nd test case : When p > 50 is True (2nd Branch)
(2) 100 % Statement coverage : Each executable statement
executed atleast once.
Again 2 Test cases are required.
1st test case : When P+Q > 100 is True
2nd test case : When p > 50 is True
(3) Path coverage :
4 Test cases are required because 4 paths are possible.
1st : When P+Q > 100 is true but P>50 is false
2nd : When both "P+Q > 100" and "P>50" are true.
3rd : When both "P+Q > 100" and "P>50" are false.
4th : When P+Q > 100 is false but P>50 is true.
Cheerz,
Saurabh Garg
| Is This Answer Correct ? | 4 Yes | 13 No |
how to write testcases for google registration screen? Please give me the answer ASAP.send me the answer to gutha_424@yahoo.co.in.
Smoke Test Checklist for Gmail please someone help!
test cases for black board test cases for pencil
testcases for biggest of three numbers?plz give the answer
What is the role of QA in a development project?
How do you differentiate the roles of Quality Assurance Manager and Project
how to write test cases for credit card payment
How to write test cases for manual testing? What are the main syntex for writing test cases for Junit?
What are the test scenario's for pen like high priority high seviority?
4 Answers NetWeb, Zycus Infotech,
If the pseudo code below were a programming language ,how many tests are required to achieve 100% statement coverage? 1. If x=3 then 2. Display_messageX; 3. If y=2 then 4. Display_messageY; 5. Else 6. Display_messageZ; 7. Else 8. Display_messageZ; A. 1 B. 2 C. 3 D. 4
Given the following: Switch PC on Start "outlook" IF outlook appears THEN Send an email Close outlook A. 1 test for statement coverage, 1 for branch coverage B. 1 test for statement coverage, 2 for branch coverage C. 1 test for statement coverage. 3 for branch coverage D. 2 tests for statement coverage, 2 for branch coverage E. 2 tests for statement coverage, 3 for branch coverage
How to write test cases on for Logging management?