Java Reference
In-Depth Information
Test the Solution — Phase 5
Testing the solution is a very important phase in the program development
cycle. The purpose of testing is to verify that the program meets the require-
ments from the user's point of view. The program should perform its assigned
function correctly under all normal circumstances. If the program includes a
user interface, testing should ensure that the user interface also meets require-
ments. For larger projects, a test plan typically is developed and agreed on
during the analyze requirements phase. A test plan consists of a collection of
test cases. Test cases are individual scenarios that include input data and
expected output data, and are designed to ensure that the program solves the
particular problem indicated in the program requirements.
If a finished application involves several programs or components,
integration testing must be completed to ensure that all programs and
components interact correctly.
The end result of testing the solution includes documentation of any
problems with the application. If the user accepts the program as complete and
correct, then the user documents this fact, and the program may be put to use.
If the testing results are unsatisfactory, then the results are documented and
returned to the programmer. The resolution of the problems revealed during
testing begins a new iteration of the development cycle, with the outstanding
issues serving as requirements.
The Shipping Charge Calculator application requires testing to ensure that
all possible cases of valid input data cause the program to calculate the correct
result every time. The application must not allow the user to enter values disal-
lowed by the requirements, such as non-numeric data. Test cases also should
include input data that would result in the weight being greater than 16 ounces.
Based on the requirements, the value of 16 ounces is called a boundary value.
Boundary values are values that cause a certain rule to become effective. Test
cases include the testing of exact boundary values because common logic and
programming mistakes occur when boundary values are reached in a problem.
Figure 1-18 shows the Shipping Charge Calculator in the GUI environment
being tested with an input value of 24 ounces. Per the requirements, the correct
charge should be calculated by adding $12.95 for the first 16 ounces and 30 cents
for every ounce thereafter, which results in a total shipping charge of $15.35.
output is
$15.35
input is
24 ounces
click Calculate
Shipping button
to calculate
FIGURE 1-18
 
Search WWH ::




Custom Search