Software Testing NPTEL Week 6 Assignment Answers
Are you looking for Software Testing NPTEL Week 6 Assignment Answers? You’ve come to the right place! Access the latest and most accurate solutions for your Week 6 assignment in the Software Testing course. Our detailed answers are designed to help you understand key concepts and excel in your studies. Stay updated with the most recent information and answers by joining our Telegram channel.
Course Link: Click Here
Table of Contents
Software Testing NPTEL Week 6 Assignment Answers (July-Dec 2024)
1. Typically, how do logical constraints occur in pre-conditions and postconditions that specify assumptions on inputs to methods or describe the properties of the methods?
A) The logical conditions can be any logical predicate.
B) The logical conditions occur in conjunctive or disjunctive normal form.
C) The logical conditions are a simple OR or AND combinations of two or more clauses.
D) The logical conditions always describe what the methods should not process as inputs.
Answer: B) The logical conditions occur in conjunctive or disjunctive normal form.
2. State true or false: It is desired that a logical predicate used in a decision statement be a tautology.
A) True.
B) False.
Answer: B) False.
3. How do logical predicates occur in finite state machines?
A) They occur as guards in the transitions of a finite state machine.
B) They occur as predicates in the states of a finite state machine.
C) They occur in the actions labeling the transitions of a finite state machine.
D) They occur in the events of a finite state machine.
Answer: B) They occur as predicates in the states of a finite state machine.
4. State true or false: The logical predicates occurring in the condition statements of a method are all simple propositional logic formulas.
A) True.
B) False.
Answer: B) False.
Consider the following code that has two conditional statements and the corresponding two logical predicates. Answer the following questions with reference to logical coverage criteria on this code.
import java.util.Scanner;
class Sum_Odd_Number
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.print("Enter The Number of Limit : ");
int l =input.nextInt();
int sum = 0;
for(int s=1;s<=l;s++)
{
if(s%2==1)
sum = sum + s;
}
System.out.println("Sum of Odd Numbers :"+sum);
}
}
5. Which of the options below best describe what the above program computes?
A) It computes the sum of all the numbers up to the limit l.
B) It computes the sum of all the even numbers up to the limit l.
C) It computes the sum of all the odd numbers up to the limit l.
D) It computes the number of odd numbers up to the limit l.
Answer: C) It computes the sum of all the odd numbers up to the limit l.
6. How many clauses are there in the above program, per predicate?
A) There are two predicates, each having one clause.
B) There are two clauses in the program, to be considered as a part of the second predicate.
C) There are four clauses in the program, two per predicate.
D) There are l different clauses in the program, one for each iteration of the loop.
Answer: A) There are two predicates, each having one clause.
These are Software Testing NPTEL Week 6 Assignment Answers
7. What does predicate coverage test for the second clause in the above program?
A) It tests for the number being odd or even.
B) It tests for the number being within or outside the limit.
Answer: A) It tests for the number being odd or even.
8. What does the test case for predicate coverage evaluating to true for the first predicate mean in the above program?
A) The first predicate evaluating to true indicates repeated iterations of the for loop.
B) The first predicate evaluating to true indicates exit from the for loop.
Answer: A) The first predicate evaluating to true indicates repeated iterations of the for loop.
9. State true or false: Clause coverage and predicate coverage are the same for both the predicates in the above program?
A) True.
B) False.
Answer: A) True.
10. In the ith iteration of the for loop, which of the following represents the actual predicate corresponding to the if statement?
A) The predicate in the ith iteration is s%2 == 1.
B) The predicate in the ith iteration is (1 + i)%2 == 1.
C) The predicate in the ith iteration is i%2 == 1.
D) The predicate in the ith iteration is 1%2 == 1.
Answer: A) The predicate in the ith iteration is s%2 == 1.
These are Software Testing NPTEL Week 6 Assignment Answers
All Weeks of Software Testing: Click here
For answers to additional Nptel courses, please refer to this link: NPTEL Assignment Answers