INTERVIEW QUESTIONS
MICROSOFT
DOTNET
DETAILS
Question: What is cyclomatic complexity and why is it important?
Answer: Cyclomatic complexity is a computer science metric (measurement) developed by Thomas McCabe used to generally measure the complexity of a program. It directly measures the number of linearly independent paths through a program’s source code. The concept, although not the method, is somewhat similiar to that of general text complexity measured by the Flesch-Kincaid Readability Test. Cyclomatic complexity is computed using a graph that describes the control flow of the program. The nodes of the graph correspond to the commands of a program. A directed edge connects two nodes, if the second command might be executed immediately after the first command. By definition, CC = E - N + P where CC = cyclomatic complexity E = the number of edges of the graph N = the number of nodes of the graph P = the number of connected components
|
Question:
What is cyclomatic complexity and why is it important?
Answer:
Cyclomatic complexity is a computer science metric (measurement) developed by Thomas McCabe used to generally measure the complexity of a program. It directly measures the number of linearly independent paths through a program’s source code. The concept, although not the method, is somewhat similiar to that of general text complexity measured by the Flesch-Kincaid Readability Test. Cyclomatic complexity is computed using a graph that describes the control flow of the program. The nodes of the graph correspond to the commands of a program. A directed edge connects two nodes, if the second command might be executed immediately after the first command. By definition, CC = E - N + P where CC = cyclomatic complexity E = the number of edges of the graph N = the number of nodes of the graph P = the number of connected components Source: CoolInterview.com
cyclomatic complexity defines, how much complex does our computer program is. means, it defines the overall degree of hardness in working of our program. if we are working through flow graphs,we can define cyclomatic complexity(CC) as ... CC= P + 1.... i.e. P- no. of predicate nodes.which means no. of nodes from which two or more than two edges are falling out. Source: CoolInterview.com
Answered by: anuj | Date: 7/22/2010
| Contact anuj
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|