Testing Lab
-
Download the code for the program you will be testing.
-
The program defines a
class for an undirected graph. Read and understand what the class and all of
its functions are doing.
-
Write a test function for each function inside of the Graph class.
These test functions should test all special cases. For example:
for removeVertex, test removing vertices that are connected to many
other vertices and vertices that are connected to no other vertices.
Each test function must use assert statements. Implement as many test cases
as possible that don't require manual verification. For functions where
this is difficult to do, you must use the Graph::print function.
-
Use your test functions to find any bugs, or make your test functions effective
enough to determine that no bugs exist.
Your test functions for removeVertex and calculatePathWeight should NOT be
working at this point.
The reason for this is that these functions haven't been implemented
yet.
-
Implement the removeVertex and calculatePathWeight functions. Tests your
implementations with the previously defined test functions.
-
Perform regression testing to make sure that your implementations of removeVertex
and calculatePathWeight did not break the previously implemented code.
-
When you have finished, get checked off by the TA and turn in your code online.