This design studio helps you get started with writing JUnit tests.
Read the slides on inspections and software testing, black box testing, and JUnit.
Read the documentation of the Java HashMap class. In particular, focus on the specifications of the methods for which you will write JUnit tests in class. The methods are listed in the next section.
Your team must have at least one laptop to work on this design studio in class. Remember to pack your laptop!
You will work on these tasks as a team. There will be one submission per team. We will pass out an attendance sheet where each student will write his/her name.
Each test method should test only one method in the HashMap class, and only one aspect of it. Use the testing strategies that we covered in previous lectures. For example, you may want to test using an empty HashMap in one test case and a non-empty HashMap in another. To test the put method, use values that are already in the HashMap in one test case, and a value that is not in the HashMap in another. Try out various inputs from equivalence classes as well as boundary cases. You will end up with about 4-5 test methods for each of the five methods listed above.
Your tests must use all of the following assertions in some way.
Your test code should compile and run. To Run, right click on the HashMapTest.java file in the package explorer and "Run as" JUnit Test. You will see a green bar if the tests pass or a red bar if a test fails.
Submit your file HashMapTest.java using the Canvas submission named DS3, which has been set up for this Design Studio. The file must be submitted by the end of the lecture, otherwise, Canvas will not accept the submission and you will not get any credit for the design studio.