MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SOFTWARE ENGINEERING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Cyclomatic complexity is equal to
A
Number of paths
B
Number of independent paths
C
Number of edges
D
None of the above
Explanation: 

Detailed explanation-1: -Cyclomatic complexity of a code section is the quantitative measure of the number of linearly independent paths in it. It is a software metric used to indicate the complexity of a program. It is computed using the Control Flow Graph of the program.

Detailed explanation-2: -Independent path is defined as a path that has at least one edge which has not been traversed before in any other paths. Cyclomatic complexity can be calculated with respect to functions, modules, methods or classes within a program.

Detailed explanation-3: -McCabe showed that the cyclomatic complexity of any structured program with only one entry point and one exit point is equal to the number of decision points (i.e., “if” statements or conditional loops) contained in that program plus one.

Detailed explanation-4: -Cyclomatic complexity (CYC) is a software metric used to determine the complexity of a program. It is a count of the number of decisions in the source code. The higher the count, the more complex the code.

Detailed explanation-5: -Cyclomatic Complexity V(G) = e-n + 2*P is a formula based on edges and nodes. Where e is the number of edges, n denotes the number of vertices, and P denotes the number of connected components.

There is 1 question to complete.