The George Washington University
School of Engineering and Applied Science
Department of Computer Science
CSci 131 -- Algorithms and Data Structures I
Lab #3
For labs meeting on Feb. 3, 2000
This exercise will help you learn to write a test plan for a package,
and a package test program.
Develop a plan to test Dates, and a test program that implements
the plan. You will actually need two test programs.
-
Test to ensure that only the package-provided operations on Date
values. That is, the program will attempt to use "bogus" Date
operations like adding two times together, multiplying a Date
by a constant, etc. Also test to ensure that a private type is really private,
that is, that a client program cannot directly access the fields of a Date
value. If all is well with the compiler, this program will fail to compile;
a successful test will result in a number of compilation error messages.
-
Test to ensure that the package-provided operations behave properly.
This is not a full-scale project, just a lab exercise, so if you won't
be able to complete the test program during the lab time, try to get a
part of it working, so that you understand the issues in writing test programs.
This will help you greatly in forthcoming labs and projects!