Question: White Box Testing Given the following method in Java, which finds the maximum value in an array of integers. public static int maximumValue(int[] a) {

White Box Testing

Given the following method in Java, which finds the maximum value in an array of integers.

public static int maximumValue(int[] a) {

if (a != null && a.length > 0) {

int max = a[0];

for (int i = 1; i < a.length; i++) {

if (a[i] > max) {

max = a[i];

}

}

return max;

}

return Integer.MIN_VALUE;

}

Design a test suite with the fewest number of test cases that satisfies the statement test criterion.

Design a test suite with the fewest number of test cases that satisfies the branch-condition test criterion.

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!