All Exams Test series for 1 year @ ₹349 only
Question

Which one of the following is used to compute cyclomatic complexity ?

This question was previously asked in
UGC NET 2014 Paper 2 Computer Science and Applications Question Paper (28-Dec-2014)
The correct answer is

P + 1, where P is the number of predicate nodes in the flow graph G.

Cyclomatic complexity \(V(G)\) of a flow graph G gives the number of independent paths, used in basis path testing.

It can be computed in three equivalent ways: the number of regions of the flow graph; \(V(G) = E - N + 2\), where E is the number of edges and N the number of nodes; and \(V(G) = P + 1\), where P is the number of predicate (decision) nodes.

So the number of regions minus 1, \(E - N + 1\) and \(P - 1\) are each smaller than the true value by one or two, and only the predicate-node count plus one matches the definition.

Example: an if–else gives 1 predicate node, 4 nodes, 4 edges and 2 regions; \(P + 1 = 2\) and \(E - N + 2 = 2\), agreeing.

Hence, the answer is P + 1, where P is the number of predicate nodes in the flow graph G..

Was this answer helpful?

Similar Questions

  1. Which one of the following is not a source code metric ?

  2. Maximum possible value of reliability is

  3. Debugger is a program that

  4. Which one of the following set of attributes should not be encompassed by effective software metrics ?

  5. Software testing is

  6. Assume that a program will experience 200 failures in infinite time. It has now experienced 100 failures. The initial failure intensity was 20 failures/CPU hr. Then the current failure intensity will be

  7. Which one of the following is not a definition of error ?

  8. Regression testing is primarily related to

  9. Which of the following statement(s) is/are TRUE with regard to software testing ?

    I. Regression testing technique ensures that the software product runs correctly after the changes during maintenance.

    II. Equivalence partitioning is a white-box testing technique that divides the input domain of a program into classes of data from which test cases can be derived.

  10. Which of the following are facts about a top-down software testing approach ?

    I. Top-down testing typically requires the tester to build method stubs.

    II. Top-down testing typically requires the tester to build test drivers.


Important Questions from Software Testing

  1. Assertion(A):Rubber necking might be called non generative pattern
    Reason(R): Non generative pattern describes a content and a problem but it does not provide any clear cut solution.
  2. Which method can be applied to problems in which the input domain is relatively small but too large to accommodate exhaustive testing?
  3. Good design dictates that error conditions be anticipated and error-handling paths set up to reroute or clearly terminate processing when an error does occur. This approach is called ________.

  4. The cyclomatic complexity of a flow graph V(G), in terms of predicate nodes is :
    Where P is number of predicate nodes in flow graph V(G).
  5. The extent to which a software tolerates the unexpected problems, is termed as :
Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
WB SET
December 13, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) December 2026 Mock Test Series
799 Tests 2 Tests Free
300 Attempts
4.4(45)
English, Hindi
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App