Hit The Order Button To Order A **Custom Paper**

>> CLICK HERE TO ORDER 100% ORIGINAL PAPERS FROM AustralianExpertWriters.com <<

24 Aug
2019

Complete the Exercises for Section 3.2, Programming #1, in Ch. 3, – NO PLAGIARISM

In this section, we discuss how to specify the tests needed to test a program system and its components. The test data may be specified during the analysis and design phases. This should be done for the different levels of testing: unit, integration, and system. In black-box testing, we are concerned with the relationship between the unit inputs and outputs. There should be test data to check for all expected inputs as well as unanticipated data. The test plan should also specify the expected unit behavior and outputs for each set of input data.
In white-box testing, we are concerned with exercising alternative paths through the code. Thus, the test data should be designed to ensure that all if statement conditions will evaluate to both true and false. For nested if statements, test different combinations of true and false values. For switch statements, make sure that the selector variable can take on all values listed as case labels and some that are not.
For loops, verify that the result is correct if an immediate exit occurs (zero repetitions). Also, verify that the result is correct if only one iteration is performed and if the maximum number of iterations is performed. Finally, verify that loop repetition can always terminate.
EXERCISES FOR SECTION 3.2
SELF-CHECK
List two boundary conditions that should be checked when testing method readInt below. The second and third parameters represent the upper and lower bounds for a range of valid integers.
/** Returns an integer data value within range minN and maxN inclusive
* @param scan a Scanner object
* @param minN smallest possible value to return
* @param maxN largest possible value to return
* @return the first value read between minN and maxN
*/
public static int readInt (Scanner scan, int minN, int maxN) {
if (minN > maxN)
throw new IllegalArgumentException (“In readlnt, minN ” + minN + ” not <= maxN ” + maxN) ;
boolean inRange = false; // Assume no valid number read.
    int n = 0;
  while (!inRange) { // Repeat until valid number read.
System.out.println(“Enter an integer from ” + minN + ” to ” + maxN + “: “) ;
try {
n = scan.nextlnt();
inRange = (minN <= n & & n <= maxN) ;
  } catch (InputMismatchException ex) {
scan.nextLine();
System.out.println(“not an integer – try again”);
}
} // End while
return n; // n is in range
}
Devise test data to test the method readInt using
white-box testing
black-box testing
PROGRAMMING
Write a search method with four parameters: the search array, the target, the start subscript, and the finish subscript. The last two parameters indicate the part of the array that should be searched. Your method should catch or throw exceptions where warranted.

QUALITY: 100% ORIGINAL – NO PLAGIARISM.

  • **REMEMBER TO PRECISE PAGE NUMBER**
  • Hit The Order Button To Order A **Custom Paper**

>> 100% ORIGINAL PAPERS FROM AustralianExpertWriters.com <<