What is Cyclomatic Complexity?

What is Cyclomatic Complexity?

Cyclomatic complexity or conditional complexity is a software metric or measurement. It was developed by Thomas J. McCabe in 1976 and is used to measure the complexity of a program. It directly measures the number of linearly independent paths through a program\'s source code. It is basically a software metric that provides a quantitative measure of the logical complexity of a program. 

Cyclomatic complexity measures the amount of decision logic in a single software module. It is used for two related purposes in the structured testing methodology.
> It gives the number of recommended tests for software.
> It is used during all phases of the software lifecycle, beginning with design, to keep software reliable, testable, and manageable.       

Cyclomatic complexity is based entirely on the structure of software\'s control flow graph.Cyclomatic complexity is computed using the control flow graph of the program, the nodes of the graph correspond to the commands of a program, and a directed edge connects two nodes if the second command might be executed immediately after the first command.Cyclomatic complexity is the most widely used member of a class of static software metrics.

Cyclomatic complexity may be considered a broad measure of soundness and confidence for a program. Its mainly a measurement of the intricacy of a program module based on the number of repetitive cycles or loops that are made in the program logic. It is used as a general measure of complexity for software quality control as well as to determine the number of testing procedures.

By:UMANG
Date:2023-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related TESTING Subjective Links

TESTING Subjective interview questions and answers for experienced and fresher