Design and Testing
OverviewThis lab will hopefully familiarize you with the Top-down and Bottom-up design paradigms. We will use code from Sedgewick and Wayne and will first read over and understand the code and the Top-down design process behind. Then we will write Bottom-up tests for the code.
IntroductionFirst, download the code for the lab and begin to read over the implementation of MinPQ that Sedgewick and Wayne wrote. Think about how the Top-down design paradigm was useful in writing the MinPQ class. The StdIn and StdOut classes are not of interest to us but are dependencies of MinPQ, so we need them to test the methods in MinPQ.
Your class will discuss the implementation and the design ideas used for MinPQ after you have had a chance to take a look at the code.
Testing the CodeNext, you will get a chance to write JUnit tests for the MinPQ class. Try to test the insert and delMin methods. Make sure to test for edge cases just as you would for a homework assignment.
Try to think about the difference in style when testing compared to the style when writing code; the tests are written in a Bottom-up fashion. Why is duality helpful? Your class will discuss the differences in style and the usefulness of each.