Question: A Java method to compute the sum of 1 . . n is shown in the following Java code below: a ) Draw the corresponding

A Java method to compute the sum of 1.. n is shown in the following Java code below:
a)Draw the corresponding control flow graph for the method.
b)Calculate the Cyclomatic Complexity of the sum(int) method (10pts)
c)list the paths and Design test cases to achieve 100% statement coverage
d) List the basis set of linearly independent paths, along with a test case (input parameters) and expected outcome for each of the path in the basis sets. public int sum(int n, int upperbound){
int result, i;
result =0;
i =0;
if (n <0){
n =-n;
}
while(i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!