Question 1
Which of the following represents the order in which artifacts are written in test driven development?
Code followed by test cases.
Test cases followed by code.
The IIT Madras BS Software Testing (Software Testing) Quiz 1 paper sat on 16 Oct 2022, in the September 2022 term, set QPF1: 14 questions for 63 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
Which of the following represents the order in which artifacts are written in test driven development?
Code followed by test cases.
Test cases followed by code.
Correct answer
Test cases followed by code.
Which of the following is true about def-clear paths with respect to a variable v?
The variable v is not defined along the path.
The variable v is not given another value along the path
The variable v is defined once but is not used along the path.
The variable v is defined and used along the path.
Correct answer
The variable v is not given another value along the path
A test case is said to have passed when which of the following holds?
The actual output is different from expected output but there is no error.
The actual output is the same as the expected output.
The software produces an output successfully upon giving an input
There is a message that there is no error from the program.
Correct answer
The actual output is the same as the expected output.
Which of the following represents the correct order of subsumption amongst data-flow coverage criteria in graphs? Read the symbol → below as “subsumes”.
All-defs-coverage → all-du-paths-coverage → all-uses-coverage.
All-defs-coverage → all-uses-coverage → all-du-paths-coverage.
All-du-paths-coverage → all-uses-coverage → all-defs-coverage.
All-du-paths-coverage → all-defs-coverage → all-uses-coverage
Correct answer
All-du-paths-coverage → all-uses-coverage → all-defs-coverage.
It accepts all the binary strings having an odd number of 0s.
It accepts all the binary strings having an odd number of 1s.
It accepts all the binary strings having an odd number of 0s and an oddnumber of 1s.
It accepts all the binary strings having an even number of 0s and an evennumber of 1s.
Correct answer
It accepts all the binary strings having an odd number of 1s.
For a tester to observe an error or a fault in a particular location of a program, which of the following should be true together?
The location of the program should be reachable by the test case given by thetester.
The state of the program must be incorrect at that location of the program.
The final state of the program should be incorrect.
The tester should see the error in the program.
Correct answers
The location of the program should be reachable by the test case given by thetester.
The state of the program must be incorrect at that location of the program.
The final state of the program should be incorrect.
a=5, b=7
a=5, b=5
a=8, b=7
a=0, b=1
Correct answers
a=5, b=7
a=0, b=1
Consider that a coverage criteria C1 subsumes coverage criteria C2. Also that there exists a test set T1 that satisfies C1 on some code base B and another test set T2 that satisfies C2 on the same code base B.
Select the statements that are correct for the above scenario.
T1 will necessarily satisfy C2.
T2 wil necessarily satisfy C1
If T2 exposes some fault in B implies that T1 will also be able to expose thesame fault.
None of these
Correct answer
T2 wil necessarily satisfy C1
Correct answer: 2
Consider the annotated CFG (for dataflow coverage) given below and answer the given subquestions.
Consider the annotated CFG (for dataflow coverage) given below and answer the given subquestions.
How many du-pairs are there for the variable m?
8
9
10
11
Correct answer
10
Consider the annotated CFG (for dataflow coverage) given below and answer the given subquestions.
Consider the annotated CFG (for dataflow coverage) given below and answer the given subquestions.
How many unique du-paths are there for the variable m?
7
8
9
10
Correct answer
7
Consider the CFG given below and answer the given subquestions.
Consider the CFG given below and answer the given subquestions.
How many test requirements are there for edge-pair coverage?
10
11
12
13
Correct answer
12
Consider the CFG given below and answer the given subquestions.
Consider the CFG given below and answer the given subquestions.
How many simple paths are present in the given CFG?
27
29
31
36
Correct answer
36
Consider the CFG given below and answer the given subquestions.
Consider the CFG given below and answer the given subquestions.
How many test requirements are there for prime path coverage?
10
11
12
13
Correct answer
11