CS 230 Fall 2006                                Assignment 10 – Developing and using test cases for a program           50 points

Assigned: 11/09/2006

Due: 11/17/2006 at the start of class (Note, we will have a new assignment for lab on 11/16)

 

IT IS NOT APPROPRIATE TO GET ANSWERS FROM CLASSMATES ON THIS ASSIGNMENT!! WORK INDIVIDUALLY !!!!!

 

Pre-Lab (Do Before Lab):  None – Attend start of lab on 11/09 – when testing strategy will be discussed!

 

Main Assignment:

There is a buggy version of a program, named DiscountTShirtsIFWrong, available in the assignments page of my WWW site (Look under Assignments at www.lasalle.edu/~redmond/teach/230 ). Save it to disk and if I ended up zipping it to put it on the WWW, unzip it. The program is described below. However, this version has bugs. Your mission is to test it, so you can notify the developer which test cases provide incorrect results. The skills learned here can also be useful for testing your own programs.

 

What I want from you is (either hand in via paper or e-mail to redmond@lasalle.edu  is fine):

 

1)       The answer to: How many test cases (runs through the program) are necessary to thoroughly and completely test the program? EXPLAIN YOUR ANSWER!!! 

2)       Tell me what runs you did. Indicate which test cases gave correct results and which exposed flaws in the program. Using table form would be helpful! Vague or broad descriptions are not sufficient.

 

You DO NOT have to determine what the problem(s) are or how to fix them. The focus of this assignment is on catching bugs. My plan is to only provide you the executable; you will not be able to see the code in order to fix it at all.

 

Ok, here's the application description (Hmm, this sounds kinda familiar):

 

Boardwalk T-Shirts Inc is having a clearance sale on 2006 Wildwood beach souvenirs.  Imagine that you are writing a simplified program for sales clerks to use while checking out customers. There are only two items for sale, T-shirts for $8.00 each, and sweatshirts for $18 each. If a customer buys 5 or more of either, they get a 10% discount for all items of that type. This will require obtaining the number of T-shirts and number of sweatshirts bought. The task also involves performing calculations and displaying the output. Output should include: price for each type of merchandise (which is standard), “extended price” (number of an item times its price), discounted subtotals (same as extended price if no discount given),  total discounted purchase amount (for both kinds of items combined), tax (at 7%), and grand total including tax. Provide capabilities to calculate, clear the text boxes to start again, and to exit.

 

Details:

1.        The program should ensure that the user types in valid data (i.e. numeric data; purchases no lower than 0)

2.        Hopefully the summary information is self-explanatory. Any questions about what they are, please ask!!

3.        If you have any questions about the pricing scheme, please ask!!!

 

Note that everything above was taken from a description of a task for a previous assignment. It is not your task. You are not developing anything! Your task is to use test cases to gather evidence about problem(s)!! The skills learned here can also be useful for testing and debugging your own programs.