answersLogoWhite

0

What is cyclomatic complexity?

Updated: 11/3/2022
User Avatar

Wiki User

15y ago

Best Answer

Cyclomatic complexity is a software metric (measurement) developed by Thomas McCabe 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. One of the ways is counting the number of closed loops in the flow graph, and incrementing the number by one. i.e. M = Number of closed loops + 1

where M = Cyclomatic number. Implications for Software Testing

M is a lower bound for the number of possible paths through the control flow graph.

M is an upper bound for the number of test cases that are necessary to achieve a complete branch coverage.

For example, consider a program that consists of two sequential if-then-else statements. if (c1) {

f1();

} else {

f2();

}

if (c2) {

f3();

} else {

f4();

} To achieve a complete branch coverage, two test cases are sufficient here.

For a complete path coverage, four test cases are necessary.

The cyclomatic number M is three, falling in the range between these two values, as it does for any program.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is cyclomatic complexity?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which metric do you generate to determine how effective the team is at eliminating defects from the project?

Cyclomatic complexity


Describe the complexity problem that arises in a multiprocessing system?

partial answer: Cyclomatic complexity (or conditional complexity) is a software metric (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.


What is Cyclomatic complexity of recursive factorial problem?

Consider the following factorial algorithm (C#):uint factorial(uint n) {if (n


What is time complexity of bubble sort?

O(n*n)


What is cyclomatic number of a graph is called?

cyclomatic number of a graph is e.n+1 where e is number of edge of graph and n is number of node in graoh g


What is are the time complexity or space complexity of DES algorithm?

time complexity is 2^57..and space complexity is 2^(n+1).


What is a sentence with the word complexity?

A sentence with the word complexity is this sentence doesn't have much complexity.


When was The Complexity of Cooperation created?

The Complexity of Cooperation was created in 1997.


When was Complexity - journal - created?

Complexity - journal - was created in 1995.


Is cost of network is determined by circuit complexity?

switching complexity


History and Examination?

History and examination is determined by these 4 complexities: Straightforward. Low complexity. Moderate complexity. High complexity.


How would you use complexity in a sentence?

The complexity of this question is to great for an adequate answer