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. Assume a significance of 0.1 on fuel_level. Assume the fuel_level range is 0 to 100.1 gallons inclusive. Use the following template for the test case table.

1. When expected outputs are the same as inputs - test cases must set each value to something other than the expected output.

2. Add the number of test 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.

1 public void setAlerts (double fuel_level, Problem3Class alerts) {

2

3 alerts.setChime(false); alerts.setRed_light(false); alerts.setYellow_light(false);

alerts.setGreen_light(false);

4 if (fuel_level<10.0)

5 alerts.setChime(true);

6 else

7 if (fuel_level<20.0)

8 alerts.setRed_light(true);

9 else

10 if (fuel_level<30.0)

11 alerts.setYellow_light(true);

12 else

13 if (fuel_level<100.0)

14 alerts.setGreen_light(true);

15 }

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!