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

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).

The correct answer is
P + 1

Cyclomatic Complexity Using Predicate Nodes

Cyclomatic complexity, denoted as $V(G)$, is a software metric used to indicate the complexity of a program or flow graph. It directly relates to the number of linearly independent paths through the code.

A common formula for calculating cyclomatic complexity, particularly when focusing on decision points, uses the number of predicate nodes.

A predicate node is a node in a flow graph that corresponds to a conditional statement (like an if, while, or case statement) which controls the flow. The formula is:

$ V(G) = P + 1 $

Where $P$ represents the total number of predicate nodes within the flow graph $V(G)$.

This formula provides a straightforward way to quantify complexity based on the number of decision points.

Therefore, the correct representation of cyclomatic complexity in terms of predicate nodes (P) is $P + 1$.

Was this answer helpful?

Important Questions from Software Testing

  1. Which of the following is/are the types of testing?

  2. Alpha and Beta testing are forms of

  3. Fault base testing technique is

  4. Which of the following is/are behavioral testing technique(s) ?

    (A) Equivalence Partitioning

    (B) Graph-Based Teating Method

    (C) Boundery Value Analysis

    (D) Data flow Testing

    (E) Loop Testing

    Choose the correct answer from the options given below:

  5. In software testing, beta testing is the testing performed by _______.

Need Expert Advice?

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