Testing Someone Else's Code
For one point of extra credit, you will be given a sample class reqresenting a square matrix. Your job is come up with a series of unit tests that will either illustrate the ways in which this class is broken, or to prove to the TA conclusively that it works.
Read about matrix multiplication if you are not familiar with it. See link below.
Start by asking yourself:
- What are the class invariants?
- What are the pre and post conditions of the methods?
- What are the extreme or weird cases?
- What are some good general cases?
- Read about the class and its invariant in the javadoc comment.
- Write the pre and post conditions for each method in the javadoc.
- Proceed to write the code for the unit testing of this class.
- Explain to the TA what you found.