Question: Describe what the code seems to be doing Draw the reduced CFG (DD-path graph) - use the line numbers provided Determine the Cyclomatic complexity Develop

Describe what the code seems to be doing

Draw the reduced CFG (DD-path graph) - use the line numbers provided

Determine the Cyclomatic complexity

Develop the basis paths using the Cyclomatic complexity. Use all True paths as the initial basis path to make it easier to grade.

Develop the test cases using required input values to achieve boundary value coverage. Use a test case table to develop the test case number, inputs, expected outputs.

Determine the code coverage achieved (decision, statement, condition, etc.)

Do the test cases and outputs refute or support the code functional description?

Use basis path testing to test the following code.

Use the variable y as your return value in your test cases. Use the following template for the test case table. Assume x ranges from -4 to 10 inclusive with significance of 0.1.

Additional test instructions:

Add the number of tests required by an ECP/BV approach in addition to what basis path testing would require. For these test cases list "-" as the basis path tested.

Test non-uniform results with 1 additional testpoints for a linear function and 2 for squared function. For these test cases list "-" as the basis path tested.

1 public double calcY (double x) {

2 double y=0;

3 if (x<-0.0)

4 y=x+8;

5 else

6 if (x<4.0)

7 y=-x*x+2*x+8;

8 else

9 if (x<6.0)

10 y=4*x-16;

11 else

12 if (x<8.0)

13 y=-4.0*x+32;

14 else

15 y=0.0;

16 return y;

17 }

It has the following graph

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!