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.

6.

Which testing metric measures the amount of code exercised by tests ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: C

The metric is the coverage metric.

Code coverage measures how much of the program a test suite actually executes, usually as a percentage: statement coverage, branch (decision) coverage, condition coverage and path coverage are its common forms. Low coverage shows which parts of the code the tests never reach.

A reliability factor concerns how often the system fails in use. A coupling metric measures how strongly modules depend on one another, a design measure. MTTF (mean time to failure) is a reliability measure of average operating time before failure. None of them measures how much code the tests exercise.

Please log in or register to report this question.

7.

Black-box testing focuses on

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: C

Black-box testing focuses on input-output behavior.

A black-box tester treats the software as a closed box: test cases come from the specification, inputs are supplied and the outputs are checked against what is expected, with no knowledge of the code inside. Equivalence partitioning, boundary value analysis and decision tables are typical black-box techniques.

Internal code structure and algorithms are the concern of white-box (glass-box) testing, which designs tests from the code's paths and branches. Memory management is an implementation detail that black-box testing does not examine.

Please log in or register to report this question.

Answer: A

Black-box testing is testing without knowledge of the internal workings of the software.

The tester treats the software as a closed box, giving inputs and checking outputs against the specification, without looking at the code. Equivalence partitioning and boundary value analysis are typical techniques.

Testing by examining the code is white-box testing. Black-box testing can be done in any environment and covers all functions, not only the user interface.

Please log in or register to report this question.

9.

What is cyclomatic complexity used to measure ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: B

Cyclomatic complexity measures code complexity and the number of independent paths.

McCabe's cyclomatic complexity is computed from the control flow graph:

\[ V(G) = E - N + 2P \]

where E is the number of edges, N the number of nodes and P the number of connected components. For one routine it equals the number of decision points plus one. It gives the number of linearly independent paths, and so the minimum number of test cases for basis path testing.

It does not measure code size (lines of code), execution time or memory usage.

Please log in or register to report this question.

10.

What is the main objective of white-box testing ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: B

The main objective of white-box testing is to test based on internal code structure.

In white-box (glass-box, structural) testing the tester knows the source code and designs test cases to exercise its internal logic: statements, branches, conditions and paths, measured by coverage criteria such as statement, branch and basis path coverage.

Testing without knowledge of the internal structure is the definition of black-box testing. Testing only the user interface is a narrow kind of functional testing. Integration testing checks how modules work together and can be done in either style.

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