Question: 1 b ) Cyclomatic Complexity ( 1 2 points ) Note: A detailed discussion of the Cyclomatic Complexity metric can be found in Moodle. Task:
b Cyclomatic Complexity points
Note: A detailed discussion of the Cyclomatic Complexity metric can be found in Moodle. Task:
Specify the implemented function of the statistics method from Listing precisely, but briefly and as generally understandably as possible. Distinguish between normal behavior successful case and exceptional behavior.
YOU HAVE TO CONTINUE THE GRAPH SO YOU HAVE TO DRAW IT Complete the control flow graph CFG on the next page for the statistics method according to Listing or create a new CFG The initial node is the one with the method signature as content. Note that the Cyclomatic Complexity calculation requires a CFG with exactly one output node without an outgoing edge You can easily transform a multiexit CFG into one by adding an explicit Exit node and connecting all previous exit nodes to the new Exit node with an edge.
Hints:
Consecutive statements except the initial node between which no branching control flow takes place must be combined in a node basic blocks
Edges at branching nodes must be marked with the corresponding condition.
For the CFG note the Scala semantics regarding exceptions. To make drawing the CFG easier, only consider exceptions that can actually occur at the respective points in the program ie that you could get when calling the method with appropriate arguments Statements that no longer branch due to this simplification can be viewed as normal nonbranching statements.
Calculate the Cyclomatic Complexity of the method. If necessary, supplement the CFG from part b with additional required elements. Give the complete calculation method! TAKE THE VALUES FROM THE GRAPH AND CALCULATE IT
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
