Test Plans
What is a test plan?
Test plans are used to test computer programs during and after development. A test plan is a set of possible inputs along with their associated expected outputs. A test plan should contain at least 10 sets of possible inputs for programmers in an introductory programming course. However, a test plan must contain enough sets of possible inputs to thoroughly test the program and its algorithm. The test plan consists of a table which is broken up into main columns titled "Possible Inputs" and "Expected Outputs". In the Possible Inputs column, there must be subheadings and columns for all of the individual items that are inputted by the user or read from an external file in the exact order that they are inputted. Number your test cases as well. Under the Expected Outputs column of the test plan, you must include subheadings and columns that identify the exact output that prints or displays across from their corresponding entries in the Possible Inputs column. Also, include a column labelled "Reasons" that explains why each test case was included in the test plan and whether it is an upper or lower boundary case or another kind of special case.
When you determine the possible inputs that a user (or a file) may enter, you must think about all of the possible "boundary" cases. Each boundary case should have an entry in the Possible Inputs column. For example, if the user is expected to enter a Celsius temperature, you should include the lowest legal centrigrade temperature which is -276 degrees. While there is no upper limit to possible Celsius temperatures, you should include the boiling point of water (100 degrees) and maybe another entry higher than that. You should also include "special" cases such as the freezing point of water (0 degrees.) A test plan must also include a few "normal" input cases. If you program includes error-checking (which prevents the user from inputting bad data), you should include a test plan item that simulates bad entry. For example, if the user is supposed to enter an integer, you should include the possible inputs of 4.3 and "zero".
BEFORE you begin to write pseudocode and long before you write any code for the program, you must complete a fully-developed test plan. This is absolutely necessary. If you create the test plan later, coding problems or language issues may prejudice your open-mindedness. That is, you may not find all of the boundary cases or "tricky" inputs if you subconsciously put them out of your mind. It is always necessary to make the test plan by closely examining the program's specifications.
All programs must be thoroughly tested before they are sold or submitted for a grade. Do not rush the development of a program and hand it in before you have tested it. You still have a chance to debug your program if you learn that you have an error from administering the test plan.
Examples of a test plan:
Program Specification:
Write a program that allows the user to input three bowling scores between or including 0 and 300. The program must display the average of the inputted scores rounded to the nearest whole integer.
Test Plan: