Black Box Testing Homework

Prerequisites

  1. Read about the difference between black box and white box testing. (Skip "reader comments").
  2. Read about two Black Box Testing techniques.

Problem #1

An online store called Complete Colorguard Equipment sells customized flags for colorguard performances. The store uses a program where the customer inputs the specifics for a flag order. Customers may order poles separately from flags. The program then calculates the total cost of the order. The following input is required:

The length of the pole as an integer: 5 - 9 ft inclusive

Should the pole be weighted? Yes, No

The pattern on the flag: SOLID, STRIPES, CURVES

The preferred fabric: COTTON, NYLON.

The number of flags to be purchased as an integer: 1-99 inclusive

Each nylon flag costs $15 (tax is included in the price), plus $2 per foot over five feet. Each cotton flag costs $20 (tax is included in the price), plus $2 per foot over five feet. A weighted pole adds $5 to the total price. A discount of %10 is applied to orders of 20 flags or more. A shipping cost of $2.00 per flag is applied to the order.


Exercise: 
1. Write a list of equivalence classes for the input data to this program.
2. Write a set of test cases to exercise all the equivalence classes. (Include pattern, even though it doesn't affect the price.) For each test case indicate which classes it covers.
 

Problem #2

The New Telephone Company has the following rate structure for long distance calls:
  1. Any call started at or after 6:00 p.m. (1800 hours) but before 8:00 a.m. (0800 hours) is discounted 50%.
  2. Any call started at or after 8:00 a.m. (0800 hours) but before 6:00 p.m. (1800 hours) is charged full price.
  3. All calls are subject to a 4% Federal tax.
  4. The regular rate for a call is $0.40 per minute.
  5. Any call longer than 60 minutes receives a 15% discount on its cost (after any other discount is subtracted but before tax is added).

A computer program reads the start time for a call based on a 24-hour clock and the length of the call. The gross cost (before any discounts or tax) is printed followed by the net cost (after discounts are deducted and tax is added).
The program will assume only whole number values are input, that the duration is non-negative and the start time represents a real clock time. Results are rounded to the nearest cent.

Exercise: Write a complete set of Black Box test cases (equivalence classes and boundary value) for testing of the program which solves the problem above. Create a table like the one below.  Include a complete description field for the purpose of the each test case.
 

Case # Description Input Values
Expected Output
1


2      
3      
4      
...      

Part 2.   The instructor has an implementation of the solution to this problem.  Carry out your test plan with his program and add a column showing the ACTUAL output produced for each input.   Highlight any discrepancies between expected and actual outputs.
Instructor solution: Executable for Unix1

Part 3. Extra Credit.  Find a defect in the Hangman application that no student discovered using ad-hoc testing.  Hints:  The defect is in Swing UI.  Revealing the defect requires writing a particular entry in the wordfile.   The defect can be discovered using boundary value analysis. (To run the Swing UI, enter: java -jar Hangman.jar SwingUI)


Problem #3

Read the description of the Parcel Postage problem
Exercise: Write a complete set of Black Box test cases for testing of the program which solves the problem above. Create a table like the one below.  Include a complete description field for the purpose of the each test case.  The Transaction input field shows the input data you are creating that will be in the Transaction file.  Show the expected output using the format shown in the problem. Use this Shipping Rate Table.
 
Case # Description Transaction input
Expected Output
1


2      
3      
4      
...      

Problem #4

Imagine a program which reads in the length of three sides of a triangle and outputs a message naming the kind of triangle: EQUILATERAL, ISOCELES, or SCALENE.  Length not in range 1 - 99 cause error message INVALID INPUT.  If lengths don't make a triangle, output NOT A TRIANGLE.

Assumptions (pre-conditions for your program)

  1. Three lengths are entered separated by blanks or returns.
  2. Input of decimals or characters causes unpredictable results.
  3. Input from keyboard, simple text output to display.
  4. Even though equilateral triangle is also isoceles, only print EQUILATERAL.


Exercise: Write a complete set of Black Box test cases for testing of the program which solves the problem above. Create a table like the one below.
 
Case # Description Input Values Expected Outcomes
1 All values equal 3 3 3 EQUILATERAL
2      
3      
4      
...      



  - solution 1 -   - solution 2 -   - solution 3 -   - solution 4 -