Machine-translated by Google. Questions are authored in English.
Top

Test Case Design Techniques Questions and Answers

1.

Which of the following is a structure which does not belong to classes of loops considered for loop testing ?

Exam Year(s)

MH SET - 2019, SET Exam - 2019,

Answer: D

The structure not among the loop classes is the Structured loop.

Loop testing, a white-box technique described by Beizer and in Pressman, considers four classes of loops: simple loops, nested loops, concatenated loops and unstructured loops. Each has its own test strategy; for simple loops, for example, the tests skip the loop, pass through once, twice, m times, and n - 1, n and n + 1 times.

The fourth class is the unstructured loop, which should be redesigned to use structured programming constructs. 'Structured loop' is not one of the classes.

Please log in or register to report this question.

2.

Suppose a graph has 5 flow graph edges and 3 flow graph modes, the cyclometric complexity V(G) of flow graph G is ..............

Exam Year(s)

MH SET - 2020, SET Exam - 2020,

Answer: C

The cyclomatic complexity is 4.

For a flow graph with E edges and N nodes (the paper's 'modes'), McCabe's measure is

\[ \begin{aligned} V(G) &= E - N + 2 \\ &= 5 - 3 + 2 = 4 \end{aligned} \]

-2 is what you get by computing N - E, 2 omits the edges and nodes difference, and 8 adds E and N.

Please log in or register to report this question.

Answer: A

Basis path testing is a whitebox testing technique.

Basis path testing (printed 'Basic path'), proposed by Tom McCabe, draws the control flow graph of the code, computes its cyclomatic complexity, and derives a set of independent paths that tests must execute so that every statement and branch is exercised at least once.

Because it is designed from the internal structure of the code, it is white-box testing. Black-box techniques, such as equivalence partitioning and boundary value analysis, use only the specification, so the other options are wrong.

Please log in or register to report this question.

4.

An independent path is a path through the program that introduces set of.......... .

(i) new conditions
(ii) processing statements

Exam Year(s)

MH SET - 2023, SET Exam - 2023,

Answer: C

An independent path introduces (i) or (ii) or both.

In basis path testing, an independent path is any path through the program that introduces at least one new set of processing statements or a new condition. On the flow graph, it must traverse at least one edge not traversed by the paths already defined.

So a path qualifies if it brings in new conditions, new processing statements, or both. Restricting it to conditions alone or to statements alone is too narrow, and 'neither' would make every path count as independent.

Please log in or register to report this question.

5.

Consider the following function with line numbers.

1. Int Myfunction( )
2. {
3. int a = 24;
4. int b = 25;
5. int c;
6. if (a! = 24)
7. printf ("Is less than or not equal to 24");
8. c = a \(\lt\lt\) 2;
9. return c;
10. b = 24;
11. }

Which line numbers contain the dead code/dead variable/unreachable code in the above function definition ?

Exam Year(s)

MH SET - 2023, SET Exam - 2023,

Answer: D

The dead or unreachable code is on lines 4, 6, 7, 10.

  • Line 4: b is set to 25 but never used before the function returns, so it is a dead variable.
  • Lines 6-7: a is 24 and never changes, so the condition a != 24 is always false and the printf can never execute.
  • Line 10: it comes after the return on line 9, so it is unreachable.

Line 8 is live: it computes \(c = 24 \lt\lt 2 = 96\), which line 9 returns. So option C, which includes line 8, is wrong, and A and B each leave out a line that is dead.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Test Case Design Techniques Questions and Answers || Test Case Design Techniques MCQ Questions and Answers || Test Case Design Techniques GK Questions and Answers || Test Case Design Techniques GK MCQ Questions || Test Case Design Techniques Multiple Choice Questions and Answers || Test Case Design Techniques GK || GK on Test Case Design Techniques || Software Engineering Questions and Answers || Software Engineering MCQ Questions and Answers || Software Engineering GK Questions and Answers || GK on Software Engineering