Question: [Verification and Validation] The function is supposed to find the sum of the highest two numbers in the given array of positive integers. The program

[Verification and Validation]

The function [Verification and Validation] The function is supposed to find the sum of is supposed to find the sum of the highest two numbers in the given array the highest two numbers in the given array of positive integers. The of positive integers. The program below contains an implementation of this function. Figure 1 displays a control flow graph of the program.

program below contains an implementation of this function. Figure 1 displays a

control flow graph of the program. Based on the given implementation of

Based on the given implementation of the function the function and the control flow graph in Figure 1, answer the and the control flow graph in Figure 1, answer the following questions.

1) Is there a test case which produces the following test path:

[1, 2, 4, 6, 7, 8, 9, 12, 13, 7, 8, 9, 12, 13, 7, 8, 10, 11, 12, 13, 7, 14] ?

If there is one, describe such a test case.

Note: Here, a test case can be described by a pair (s, x) where s is an array of integers to be given to the function following questions. 1) Is there a test case which produces the following and x is the number which the function is expected to return.

2) Suppose the test suite T consists of the following 3 test cases:

([], 0) ([1], 1) ([1, 2], 3)

2a) What are the test paths produced by the test cases in T.

2b) Does the test suite T satisfy node coverage? If so, explain why it does so. If not, find the degree of node coverage of this test suite and describe an extension of this test suite which has the highest degree of node coverage.

2c) Does the test suite T satisfy edge coverage? If so, explain why it does so. If not, find the degree of edge coverage of this test suite and describe an extension of this test suite which has the highest degree of edge coverage.

3) Is there a test suite which satisfies prime path coverage? If so, describe such a test suite and explain why it satisfies prime path coverage. If not, explain why there can be no test suite which satisfies prime path coverage and describe a test suite which has the highest degree of prime path coverage.

sumo fTopTwo(int[] scores)

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!