JUnit
-
If you are not familiar with JUnit
- A simple example
- Exercise: write a JUnit test class for ConcreteClock which implements the interface Clock. Try a test-first strategy; you can write your tests just by examining the Clock Interface.
- Add an equals method to the Clock interface and ConcreteClock class that will return true if two clocks are the same (i.e. have the same hours and same minutes), false otherwise. Use this method in your JUnit tests.
- JUnit: Documentation
- If you are familiar with JUnit
- Exercise: First, use inspection to try to find as many faults as you can in QueueErr.java. For each fault you find, write down where you found it, how you would fix it, the validation technique you used (inspection or testing), and how long it took to find the fault. Then, when you are satisfied that you've found all the faults using inspection, test QueueErr.java using the JUnit test class provided below, and write down any additional faults you find. Finally, fix the faults until all the tests pass; be careful not to fix things that are not broken.