Indian Institute of Technology, Madras - BS in Data Science and Applications

Practice mode — answers are hidden. Use the toolbar below to annotate.

Sw Testing

Section : Mandatory  |  Number of Questions : 17  |  Section Marks : 100  |  Sep 25
Question Number : 190   Question Id : 6406531535608
Correct Marks : 0  |  Question Label : Multiple Choice Question

THIS IS QUESTION PAPER FOR THE SUBJECT "DEGREE LEVEL : SOFTWARE TESTING (COMPUTER BASED EXAM)"

ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.

(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)

Options :
Question Number : 191   Question Id : 6406531535609
Correct Marks : 5  |  Question Label : Multiple Choice Question
In an organization, software testers always look for failures in the software product due to which they have an adversarial relationship with the software developers. Considering this scenario, identify the maximum process maturity level of this organization.
Options :
Question Number : 192   Question Id : 6406531535610
Correct Marks : 5  |  Question Label : Multiple Choice Question
Consider the following statements and choose the correct option.
i) Prime path coverage subsumes node and edge coverage.
ii) Prime path coverage does not subsume edge-pair coverage.
Options :
Question Number : 193   Question Id : 6406531535611
Correct Marks : 5  |  Question Label : Multiple Choice Question
Which of the following are required to create a test case?
Options :
Question Number : 194   Question Id : 6406531535612
Correct Marks : 5  |  Question Label : Multiple Choice Question
Consider the following statements and choose the correct option.
i) In JUnit, each test is embedded into one test method.
ii) JUnit can be used for unit, integration as well as system testing.
Options :
Question Number : 195   Question Id : 6406531535613
Correct Marks : 5  |  Question Label : Multiple Choice Question
A __________ is a skeletal implementation of a software module, used to develop or test a component that calls the stub or depends on it.
Fill in the blank with correct option.
Options :
Question Number : 196   Question Id : 6406531535614
Correct Marks : 5  |  Question Label : Multiple Choice Question
Consider that there are two modules in a software program, namely ModuleA and ModuleB. ModuleA calls the method setup(String parameter1, String parameter2) in ModuleB. The data is passed through the parameters in the method. Which type of interface does this scenario represent?
Options :
Question Number : 197   Question Id : 6406531535615
Correct Marks : 5  |  Question Label : Multiple Choice Question
Consider the following statements regarding structural graph coverage criteria and choose the correct option.
i) A test path always begins with the initial vertex and ends in the final vertex.
ii) A prime path may contain cycles within it as a subpath.
iii) Complete path coverage may be feasible for some CFGs.
Options :
Question Number : 198   Question Id : 6406531535616
Correct Marks : 5  |  Question Label : Multiple Choice Question
The _______ approach to integration testing does not require the use of test stubs or test drivers.
Fill in the blank with the correct option.
Options :
Question Number : 199   Question Id : 6406531535617
Correct Marks : 5  |  Question Label : Multiple Choice Question
Consider the following statement and fill in the blank(s) with the appropriate option.
In a maximal chain, the interior vertices have an indegree of i)___ and outdegree of ii)___.
Options :
Question Number : 200   Question Id : 6406531535618
Correct Marks : 5  |  Question Label : Multiple Choice Question
In a data flow graph, a path from vertex vi to vertex vj is a du-path for variable x if x is __________.
Fill in the blank with the appropriate option.
Options :
Question Number : 201   Question Id : 6406531535619
Correct Marks : 5  |  Question Label : Multiple Choice Question
Consider that there are k distinct du-pairs for a variable z on a data flow graph. Which of the following options is correct regarding the TRs for All-Uses Coverage for variable z on this graph?
Options :
Question Number : 202   Question Id : 6406531535620
Correct Marks : 5  |  Question Label : Multiple Choice Question
Which of the following graph coverage criteria is equivalent to state coverage on a finite state machine (FSM)?
Options :
Question Number : 203   Question Id : 6406531535621
Correct Marks : 5  |  Max. Selectable Options : 0  |  Question Label : Multiple Select Question
Which of the following types of testing methods are white box i.e. require knowledge about the internals of the program?
Options :
Question Number : 204   Question Id : 6406531535622
Correct Marks : 5  |  Max. Selectable Options : 0  |  Question Label : Multiple Select Question
Consider the following Java code for LinAlg class, there are some faults in it. The method addVectors(int[] vec1, int[] vec2) needs to be tested using the JUnit test class TestVectorAddition.
public static class LinAlg
{
  // Inputs: Two non-empty integer arrays.
  // Effects: Performs addition of the vectors and returns the resultant vector.
  // Assumptions: Throws IllegalArgumentException if addition is incompatible.
  public static int[] addVectors(int[] vec1, int[] vec2) {
    if(vec1.length != vec2.length) {
      throw new IllegalArgumentException("Size of the vectors should be same.");
    }
    int[] result = new int[vec2.length];
    for (int i = 0; i < vec2.length - 1; i++) {
      result[i] = vec1[i] + vec2[i];
    }
    return result;
  }
}

/* ----- Test Class ----- */
import static org.junit.Assert.*;
import org.junit.Test;

public class TestVectorAddition {
  @Test
  public void testCase1() {
    int[] v1 = { 10, 20, 30, 40, 50 };
    int[] v2 = { 30, -40, 20, -10, -50 };
    int[] result = LinAlg.addVectors(v1, v2);
    assertArrayEquals(result, new int[] {40, -20, 50, 30, 0});
  }
  @Test
  public void testCase2() {
    int[] v1 = { 2, 4, 6, 8 };
    int[] v2 = { 40, -20, 10, -5 };
    int[] result = LinAlg.addVectors(v1, v2);
    assertArrayEquals(result, new int[] {42, -16, 16, 3});
  }
  @Test
  public void testCase3() {
    int[] v1 = { 1, 1, 1, 1, 0 };
    int[] v2 = { 0, 0, 0, 0, 0 };
    int[] result = LinAlg.addVectors(v1, v2);
    assertArrayEquals(result, new int[] {1, 1, 1, 1, 0});
  }
  @Test
  public void testCase4() {
    int[] v1 = { 1, 0, 0, 0, 1 };
    int[] v2 = { 1, 0, 0, 0, 1 };
    int[] result = LinAlg.addVectors(v1, v2);
    assertArrayEquals(result, new int[] {2, 0, 0, 0, 2});
  }
}
Identify which of the test cases would be able to uncover the faults in the program.
Options :
Question Id : 6406531535623   | Comprehension   | Question Numbers : (205 to 207)
Consider the following control flow graph (CFG), and answer the subsequent questions.
1 2 3 6 4 5
Edges: 1→2, 2→3, 2→6, 3→4, 3→5, 4→3, 5→2  •  Initial vertex: 1  •  Final vertex: 6
Question Number : 205   Question Id : 6406531535624
Correct Marks : 5  |  Question Label : Multiple Choice Question
How many test requirements are there for edge-pair coverage?
Options :
Question Number : 206   Question Id : 6406531535625
Correct Marks : 5  |  Question Label : Multiple Choice Question
How many test requirements are there for prime path coverage?
Options :
Question Number : 207   Question Id : 6406531535626
Correct Marks : 5  |  Question Label : Multiple Choice Question
What is the cyclomatic complexity of the given CFG?
Options :
Question Id : 6406531535627   | Comprehension   | Question Numbers : (208 to 210)
Consider the following data flow graph, and answer the subsequent questions.
1 x=a y=b z=c 2 3 y=z x=y 4 5 print(x) print(y) print(z) x < y x >= y z < x z >= x
Node 1: x=a, y=b, z=c  •  edge 1→2: x<y, edge 1→3: x>=y, edge 2→3: z<x, edge 2→4: z>=x  •  Node 3: y=z, x=y  •  Node 5: print(x), print(y), print(z)
Question Number : 208   Question Id : 6406531535628
Correct Marks : 5  |  Question Label : Multiple Choice Question
How many test requirements are there for All-Defs-Coverage for variable x?
Options :
Note: The source PDF (ST_Q1_SEP_25.pdf) is only 9 pages and ends here, at Question 208. Questions 209 and 210 of this comprehension set are not present in the file, so they could not be reproduced. Share a complete copy and I'll add them.