NPTEL Software Testing Week 11 Assignment Answers 2024
1. Which of the following lists use(s) of symbolic execution in logic-based testing?
- Symbolic execution is used to generate the predicates for logic-based testing.
- Symbolic execution is used to reach the predicates for applying logicbased testing.
- Symbolic execution is used to solve the reachability and infection problems for logic-based testing.
- Symbolic execution is used to compute the predicates for logic-based testing
Answer :- For Answers Click Here
2. When symbolic execution of a piece of code reaches a decision statement (like if), what kind of path constraints are generated?
- One path constraint, True is always generated.
- One path constraint containing the predicate of the decision statement is generated.
- Two path constraints are generated, one corresponding to the predicate with symbolic variables as it occurs in the decision statement and another corresponding to the negation of the same predicate with symbolic variables.
- Two path constraints are generated, corresponding to the predicate and negation of the predicate, as it occurs in the decision statement, with symbolic variables, and these are combined with a logical AND to the existing path constraint.
Answer :- For Answers Click Here
3. State yes or no: Can symbolic execution be used to detect the presence of non-terminating loops in a given code?
- Yes.
- No.
Answer :-
4. Which of the following is a list of all known disadvantages of symbolic execution?
- Symbolic execution is not an expressive testing technique for exploring all execution paths.
- Symbolic execution will generate path constraints that are not solvable by known constraint solvers.
- Symbolic execution will not work for code bases that use API calls and hence not useful.
- Symbolic execution can generate path constraints that are not solvable by known constraint solvers, it will not work for code that contains functions whose source code is not available, and when there are many different program paths, the path constraints might get large, making it infeasible.
Answer :-
5. State true or false: DART algorithm, when run on a program, always terminates.
- True.
- False.
Answer :-
6. What does the code fragment do?
- Tries to check if x is greater than y.
- Tries to check if y is greater than x.
- Swaps the values x and y.
- Swaps the values of x and x – y.
Answer :- For Answers Click Here
7. How many nodes will be there in the symbolic execution tree of this code fragment?
- 3 nodes.
- 4 nodes.
- 7 nodes.
- 8 nodes.
Answer :-
8. What will be the path constraint at line 1 of the code fragment such that no further execution happens?
- x > y.
- x <= y.
Answer :-
9. What will be the path constraint to reach statement 6?
- x > y && x – y > 0.
- x > y && x – y <= 0.
- x <= y.
- x > y && x – y <= 0.
Answer :-
10. Is statement 6 reachable in the given program fragment?
- Yes, it is reachable.
- No, it is not reachable.
Answer :- For Answers Click Here