The cyclomatic complexity of a flow graph V(G), in terms of predicate nodes, is: [where P is the number of predicate nodes in the flow graph V(G)]
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: A. P + 1
Explanation
McCabe's cyclomatic complexity can be computed three equivalent ways: V(G) = E – N + 2 (edges, nodes), V(G) = number of enclosed regions of the planar flow graph, and V(G) = P + 1, where P counts the predicate (decision) nodes. Each predicate node adds exactly one binary branch and therefore one more linearly independent path, so starting from a single straight-line path the count grows to P + 1. For example, a program with three simple if-statements and no other branching has V(G) = 3 + 1 = 4 independent paths, which is also the minimum number of basis-path test cases required.More Software Engineering questions
- In software testing, how are error, fault and failure related to each other?
- Verification: (A) refers to the set of activities that ensure that software correctly implements a specific function (B) gives answer to th…
- In which testing strategy are the requirements established during requirements analysis validated against the developed software?
- Software reliability is described with respect to (A) Execution Time (B) Calendar Time (C) Clock Time Choose the correct answer from the op…
- Statement I: "Quality control involves the series of inspections, reviews and tests used throughout the software process, to ensure each wo…
- According to the ISO-9126 Standard Quality Model, match List-I with List-II: List-I (Attributes) (a) Functionality (b) Reliability (c) Effi…