Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions