Quality Testing

Quality is delighting customers

1)Order numbers on a stock control system can range between 10000 and 99999 inclusive. Which of the following inputs might be a result of designing tests for only valid equivalence classes and valid boundaries?

a) 1000, 50000, 99999
b) 9999, 50000, 100000
c) 10000, 50000, 99999
d) 10000, 99999, 100000


2)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
Please give Explanation how to solve this question


Regards
Gowtham

Views: 3344

Reply to This

Replies to This Discussion

For quest 1:-
I feel b) 9999, 50000, 100000 is the correct option.

For quest 2:-

Cant say :-( SORRY
Hi,

For Query 1:

Its the option c) 10000, 50000, 99999.


For Query 2 :

Its the option a) 1 test for statement coverage, 3 for branch coverage.

no of test cases for branch coverage = no. of ifs + 1

and no. of test cases for statement coverage =1
hi,

For question 1 i think answer is :

b) 9999, 50000, 100000

And for question 2 am not sure for correct answer but i think its :

b) 1 test for statement coverage, 2 for branch coverage

Regards,
Amit
I feel for question 1 its c becouse 10000,50000,99999 comes in the valid range and for
question 2 i feel its b.
Question 1: Answer [C]

Question 2: Answer with Explanation

Actually here 3 statments are present
Statement 1: Read p,q
Staement 2: First If Condition statment, for this one test case is enough to test.
Statemtn 3: Second If Condition statement, for this one test case is enough to test.

But statement 2 and 3 are Decision statements, Generally decision coverages equal to branch coverages. So we consider these 2 decision statements as Branch coverages.

So the Correct answer for this quesiton is :[B] 1 Test for Statement Coverage and 2 for Branch Coverage.

Regards,
ILIAZ
- For quest1 :
+ The right result is option c) 10000, 50000, 99999.
+ Explanation:
> As you known: The following inputs might be a result of designing tests for only valid equivalence classes and valid boundaries (number is between 10000 and 99999 inclusive):
There's one valid equivalence class is (10000 ,99999 ) -> inputs must be fall in this range(10000,99999)
There's 2 valid boundaries values are 10000 and 99999.
-> So, good result is option c) 10000, 50000, 99999.

- For quest2:
+ The right result is option c) or b)
+ Explanation:
> first if: we must have 2 test-cases for branch coverage. ( p+q > 100) and ( p+q <= 100)
> second if: we must have 2 test-cases for branch coverage.( p > 50 ) and (p <= 50)
-> So, we have one for statement coverage: one value p > 50 and one value q which p + q > 100.
And we have 2 for branch coverage:
1. p <= 50, p + q <= 100
2. p > 50, p + q > 100; but this test-case includes in the state coverage test-case. We reject it.
Conclusion: we must have 2 test case for this test, they can cover full statement and branch coverage.
They're ( p <= 50, p + q <= 100) and ( p > 50, p + q > 100).

So, the right result is option c) or b) .
if we only count the different test case, it's option c).
if we only count number of test case for each criteria (statement and branch coverage), it's option c).

I hope that my answer is useful.

Regards,
Khanh Nguyen.
Q1). C
Q2). B


Regards,
KumarA
Hi,
For first question answer is c and
For second one answer is b...
am not sure abt the answer for second question..correct me if am wrong
Question 1: C

Question 1: B

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2022   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service