Explain cyclomatic complexityHow is it computed Software Engineering Sem 6 Mumbai university Dec 15

The Eduladder is a community of students, teachers, and programmers just interested to make you pass any exams. So we solve previous year question papers for you.
See Our team
Wondering how we keep quality?
Got unsolved questions?

Ask Questions
-Thakur-College-of-Engineering-and-Technology-Mumbai-->View question

Explain cyclomatic complexity.How is it computed?-Software Engineering-Sem 6-Mumbai university-Dec 15

It is related to software engineering.


Taged users:


Be first to dislike this question

Talk about thisDelete|Like|Dislike|


Cyclomatic Complexity are:-
1)Cyclomatic complexity is a software metric (measurement), It was developed by Thomas J. McCabe, Sr. in 1976 and used to indicate the complexity of a program.
2)It is quantitative measure of the number of linearly independent paths through a program’s source code.
3)Cyclomatic complexity is computed using the control flow graph of the program: the nodes of the graph correspond to indivisible groups of commands of a program, and a directed edge connects two nodes if the second command might be executed immediately after the first command.
*How Cyclomatic complexity is calculated
1)Cyclomatic complexity may also be applied to individual functions, modules, methods or classes within a program.
2)The cyclomatic complexity of a section of source code is the count of the number of linearly independent paths through the source code. For instance, if the source code contained no decision points such as IF statements or FOR loops, the complexity would be 1, since there is only a single path through the code. If the code had a single IF statement containing a single condition there would be two paths through the code, one path where the IF statement is evaluated as TRUE and one path where the IF statement is evaluated as FALSE.
3)Mathematically, the Cyclomatic complexity of a structured program is defined with reference to a directed graph containing the basic blocks of the program, with an edge between two basic blocks if control may pass from the first to the second (the control flow graph of the program).
The complexity is then defined as:
M = Cyclomatic complexity
E = the number of edges of the graph
N = the number of nodes of the graph
P = the number of connected components

4)The same function as above, shown as a strongly-connected control flow graph, for calculation via the alternative method. For this graph, E = 10, N = 8 and P = 1, so the cyclomatic complexity of the program is 3.
5)An alternative formulation is to use a graph is defined as
M = P + 1
6)Cyclomatic complexity = Total number of regions in the flow graph.


Be first to like this answer

Be first to dislike this answer
Talk about this|Once you have earned teacher badge you can edit this questionDelete|Like|Dislike|

Can you help us to add better answer here? Please see this

Not the answer you're looking for? Browse other questions from this Question paper or ask your own question.

Join eduladder!