Software Testing | Week 6


Link : Software Testing Week 6 (

1. While applying logic-based testing to test source code, is it true that the predicates can be taken exactly as they occur in code always?

b. No, some times we have to add extra clauses to the predicate

2. How do logical predicates occur in finite state machines?

b. The logical predicates occur as guards in the transitions of the finite state machines

3. In a requirements specification document, where do logical predicates occur?

b. They occur as pre-conditions, invariants and post-conditions in the requirements

Answer the following questions for the method twoPred() below.
The method is called with two input parameters x and y.

public String twoPred (int x, int y)
boolean z;
if (x < y)
z = true;
z = false;
if (z && x+y == 10)
return z;
return z-1;

4. State true or false: The internal variable z in the second predicate needs to be re-written in terms of the input parameters x and y.

a. True

5. Is it true that predicate coverage for the first predicate will also subsume predicate coverage for the second predicate?

b. False

6. How many test cases will be needed for clause coverage for the second predicate if we explicitly count the true and false values for each clause?

b. Four test cases

7. State true or false: The set of test case inputs {(x=5, y=3), (x=4, y=6), (x=5, y=6)} will satisfy clause coverage for the second predicate.

a. True

8. State yes or no: The set of test case inputs {(x=5, y=3), (x=4, y=6), (x=5, y=6)}

a. Yes

9. How many test cases are needed for satisfying RACC for all the clauses for the second predicate?

c. Three test cases

10. State true or false: The set of test case inputs {(x=4, y=6), (x=6, y=4), (x=4, y=5)} satisfy RACC for the second predicate.

a. True

Report any Question

Give Explaination

* The material and content uploaded on this website are for general information and reference purposes only and don’t copy the answers of this website to any other domain without any permission or else copyright abuse will be in action.

Please do it by your own first! Protection Status

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
close button
Would love your thoughts, please comment.x