Answered You can buy a ready-made answer or pick a professional tutor to order an original one.
Univeristy of PhoenixDAT/305Individual: Testing and Debugging, Section 3.2Resource: Ch. 3, "Testing and Debugging", of Data Structures: Abstraction and Design Using Java.Complete the Exercises for Sec
Univeristy of Phoenix
DAT/305
Individual: Testing and Debugging, Section 3.2
Resource: Ch. 3, "Testing and Debugging", of Data Structures: Abstraction and Design Using Java.
Complete the Exercises for Section 3.2, Programming #1, in Ch. 3, "Testing and Debugging", of Data Structures: Abstraction and Design Using Java.
Submit your pseudocode response to the Assignment Files tab.
Except from Ch. 3, Data Structures: Abstraction and Design Using Java
3.2 Specifying the Tests
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.Testing Boundary Conditions
When hand-tracing through an algorithm using white-box testing, you must exercise all paths through the algorithm. It is also important to check special cases called boundary conditions to make sure that the algorithm works for these cases as well as the more common ones. For example, if you are testing a method that searches for a particular target element in an array testing, the boundary conditions means that you should make sure that the method works for the following special cases:
The target element is the first element in the array. The target element is the last element in the array. The target is somewhere in the middle. The target element is not in the array. There is more than one occurrence of the target element, and we find the first occurrence. The array has only one element and it is not the target. The array has only one element and it is the target. The array has no elements.
These boundary condition tests would be required in black-box testing too.EXERCISES FOR SECTION 3.2SELF-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.
- @
- 838 orders completed
- ANSWER
-
Tutor has posted answer for $25.00. See answer's preview
***** ********************* please **** pseudocode If anything ** amiss ***** ******** ** **** ****** *****************