$35
CS 342 Homework#3
JUnit 5 Test Suite
Description:
In this homework you will get some practice creating a JUnit 5 test suite for the classes
in project #1.
Implementation Details:
I have provided the Maven template for project #1 including an implementation of
project #1. Also included, are the test cases we did in class. Your task is to fully test the
GenericStack and GenericQueue classes as well as the iterator. Keep in mind, there
could be errors in the code provided.
You will need to create two additional Junit5 test classes in their own files in the same
directory as ListTest.java. Call them QueueTest.java and IteratorTest.java. You will
continue to test the GenericStack in ListTest.java.
You are required to use a minimum of 3 annotations and 4 assertions in your unit tests.
Check out the link in the lecture slides for documentation. You must test the classes and
iterator in a logical, step by step, fashion. Additional to the test cases provided, A
minimum of 10 test cases per class and 10 for the iterator. You will probably need more
to fully test this program. Each class and the iterator should be tested in their own file.
Some ideas for testing the GenericStack and GenericQueue classes:
1. Test the constructor to ensure that the expected value was placed in the list.
2. In a list of three values, ensure that when you add a fourth it adds to the front
for a stack and the back for a queue
3. In an empty list, ensure that null is returned when you attempt to pop or
dequeue.
4. ensure that the length value will not be negative.
5. ensure that the length value properly increments when you create a new list.
***Above are just a few ideas to get you started. There is a lot more to
test***
CS 342 Homework#3 Fall 2019
Electronic Submission:
Put the Maven template folder with your files in a .zip and name it with your netid +
UnitTests: for example, I would have a submission called mhalle5UnitTests.zip, and
submit it to the link on Blackboard course website.
Assignment Details:
Late work on a homework is NOT ACCEPTED. Anything past the deadline will result in
a zero.
We will test all homework on the command line using Maven 3.6.1.
You may develop in any IDE you chose but make sure your homework
can be run on the command line using Maven commands. Any
homework that does not run will result in a zero. If you are unsure
about using Maven, come see your TA or Professor.