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

Test Case Design Techniques Questions and Answers

Answer: B

Cyclomatic complexity measures the number of independent logical paths in a program.

Thomas McCabe's metric is computed from the program's control flow graph as \(V(G) = E - N + 2\), where E is the number of edges and N the number of nodes, or simply as the number of decision points plus one. It gives the number of linearly independent paths, and so the minimum number of test cases needed to cover every branch.

It says nothing about the number of lines of code (that is the LOC measure), memory use or execution time.

Please log in or register to report this question.

12.

Which of the following is the method of black box testing ?

Exam Year(s)

Tripura Public Service Commission - 2026,

Answer: A

The black box method is Boundary value analysis.

Black box testing designs tests from the specification without looking at the code. Boundary value analysis does this by testing at and just around the edges of input ranges (for a valid range of 1 to 100: 0, 1, 2, 99, 100 and 101), where errors are most common.

Basis path testing and code path testing derive tests from the program's control flow, so they are white box methods. As boundary value analysis fits, 'None of these' is wrong.

Please log in or register to report this question.

13.

Basis path testing falls under

Exam Year(s)

UGC NET - 2012,

Answer: B

Basis path testing belongs to white box testing. It uses the control flow graph of the code, computes the cyclomatic complexity, and designs test cases to execute each independent path of the program, so the tester must know the internal structure.

Black box testing looks only at inputs and outputs, system testing is done on the whole system, and unit testing is a level of testing and is not the same as a technique. The basis path method is a white box technique, usually used at the unit level.

Please log in or register to report this question.

Answer: B

For a flow graph, cyclomatic complexity is V(G) = E - N + 2, with E the number of edges and N the number of nodes. It is also P + 1, with P the number of predicate nodes, and it equals the number of regions of the graph. So statements (A), (C) and (D) are correct. Statement (B) gives V(G) = N - E + 2, with the terms reversed, which would be negative for most graphs, so it is the incorrect statement. The answer is option (B).

Please log in or register to report this question.

15.

Consider the following pseudo-code :

If (A > B) and (C > D) then
    A = A + 1
    B = B + 1
Endif

The cyclomatic complexity of the pseudo-code is

Exam Year(s)

UGC NET - 2012,

Answer: B

The cyclomatic complexity of a piece of code is the number of decisions plus one. The pseudo-code has a single if statement whose condition is made of two simple conditions joined by 'and', and each simple condition counts as a decision, so there are two predicates and the complexity is 2 + 1 = 3, option (B). Counting only the whole if as one decision would give 2, and the larger values count decisions that are not there.

Please log in or register to report this question.

16.

Given a flow graph with 10 nodes, 13 edges and one connected components, the number of regions and the number of predicate (decision) nodes in the flow graph will be

Exam Year(s)

UGC NET - 2013,

Answer: B

The flow graph has 5 regions and 4 predicate nodes, which is option B. Cyclomatic complexity gives the number of regions as \(V(G) = E - N + 2P\), with E = 13 edges, N = 10 nodes and P = 1 connected component.

\[ V(G) = 13 - 10 + 2 = 5 \]

The number of predicate (decision) nodes is one fewer than the cyclomatic complexity, \(V(G) - 1 = 4\). The pair 4, 5 reverses the two values, and 3, 1 and 13, 8 do not satisfy either formula.

Please log in or register to report this question.

17.

One weakness of boundary value analysis and equivalence partitioning is

Exam Year(s)

UGC NET - 2013,

Answer: B

The weakness of boundary value analysis and equivalence partitioning is that they do not explore combinations of input circumstances. Each technique picks test values for individual inputs, at the edges of or within a class, so interactions between several inputs are left untested. Techniques such as cause-effect graphing and decision tables were introduced for that gap.

The claim that they are not effective is false, since both are widely used and productive. The option saying they do explore combinations states the opposite of the weakness.

Please log in or register to report this question.

18.

Cyclometric complexity of a flow graph G with n vertices and e edges is

Exam Year(s)

UGC NET - 2013,

Answer: B

The cyclomatic complexity of a flow graph G with e edges and n vertices is V(G) = e - n + 2, option (B). It equals the number of linearly independent paths through the program and is the minimum number of test cases needed to cover every independent path. For example, a single decision gives a graph with 4 nodes and 4 edges, so 4 - 4 + 2 = 2 paths. The general formula for a graph with p connected components is e - n + 2p, and a single procedure has p = 1. The forms e+n-2, e+n+2 and e-n-2 give wrong values, for instance e+n-2 would give 6 for the one decision graph, which is more than its 2 paths.

Please log in or register to report this question.

19.

Equivalence partitioning is a __________ method that divides the input domain of a program into classes of data from which test cases can be derived.

Exam Year(s)

UGC NET - 2013,

Answer: B

Equivalence partitioning is a black-box testing method that divides the input domain of a program into classes of data from which test cases can be derived. A class is a set of inputs that the program should treat in the same way, so one representative of each class is tested.

White-box testing works from the internal structure of the code, orthogonal array testing is a technique for choosing combinations of inputs, and stress testing pushes the system beyond its normal load. The method that works from the input classes alone is black-box testing, which is (B).

Please log in or register to report this question.

Loading…
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