Question: Use the following code to answer questions 2 - 4 : 2 . Draw a flow graph to represent the method Fun. Label the nodes

Use the following code to answer questions 2-4:
2. Draw a flow graph to represent the method Fun. Label the nodes (starting with A) and the outgoing edges of the decision boxes appropriately.
3. Identify the set P of paths in the flow graph for Fun and a set of test inputs that satisfy 100% for each of the following criteria. You are required to show trace tables for each set of inputs used to achieve the criteria. If 100% coverage cannot be obtained, explain why.
i. statement coverage
ii. branch coverage
iii. multiple condition coverage (MCC)
4. Compute the number of basis paths in the flow graph in Question 2
1. public int Fun(int x, int k, int y){
2. int i =0;
3. while (i < x){
4. if (x/2<2){
5. k = y - x;
6. k = y + i;
7.}
8. else{
9. x = k -2;
10. y = y + x;
11.}
12. k = x + y;
13. i = i +2;
14.}
15. if (x <0|| y <0){
16. k = y x;
17.}
18. else{
19. k = y + x;
20.}
21. return k;
22.}

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 Databases Questions!