Program Testing Guide

For most programs, it is practically impossible to prove that the program is correct on all inputs. Instead, you must try to convince skeptics that it mostly works right, by testing the program on various inputs and documenting what you have done. This documentation is called a test plan, and you must provide one with each program. The test plan describes how you intend to test your program, that is, which inputs you plan to test it on and why those are good choices. The reason for documenting your testing is so that The results of running a set of tests is a test log, which shows the results produced by the tests in the test plan. The log should demonstrate that each test produced the output predicted by the test plan.

IMPORTANT: It is your responsibility to make sure that your program runs on the machine specified for the assignment (e.g., lab computers, department Unix servers), even though you may develop your program on your own computer.

We will test your program for correctness on input sets of our own choosing and on the computers specified in the assignment.

Developing a Test Plan:

The programs written for this course will require you to test the execution of your programs on various sets of inputs to demonstrate program functionality. These input sets, or test cases, will be of your own choosing, but the following guidelines should be followed:

If your program does not handle certain inputs, the ASSUMPTIONS section of the program header must indicate precisely which inputs are not handled in the program.

Format for Program Test Document:

Test results must be submitted separately on paper, even if the program may be submitted on disk or electronically. The program test document should be organized as follows:

  1. Your name (and the names of any people you work with)

  2. The course number (e.g., CPSC 211) and your section number (e.g., 201-203)

  3. The name of the programming assignment (e.g., Program 1)

  4. Rationale behind chosen test cases (inputs). Note that you MUST include some justification for each test case, even if it is something as simple as testing the program on odd or even numbers.

  5. Printouts of output files for each separate input set (i.e., test logs).