Starting from:
$35

$29

Homework 2 JUnit 5 Test Suite Solution

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:




Test the constructor to ensure that the expected value was placed in the list.



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



In an empty list, ensure that null is returned when you attempt to pop or dequeue.



ensure that the length value will not be negative.



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#2










Electronic Submission:




Put the template folder with your files in a .Zip and submit to the link on Blackboard course website.




Assignment Details:




We will run your program as a Maven project with the command “test”.




Late work on a homework is NOT ACCEPTED. Anything past the deadline will result in a zero.




Unless stated otherwise, all work submitted for grading *must* be done individually. While we encourage you to talk to your peers and learn from them, this interaction must be superficial with regards to all work submitted for grading. This means you *cannot* work in teams, you cannot work side-by-side, you cannot submit someone else’s work (partial or complete) as your own. The University’s policy is available here:




https://dos.uic.edu/conductforstudents.shtml.







In particular, note that you are guilty of academic dishonesty if you extend or receive any kind of unauthorized assistance. Absolutely no transfer of program code between students is permitted (paper or electronic), and you may not solicit code from family, friends, or online forums. Other examples of academic dishonesty include emailing




your program to another student, copying-pasting code from the internet, working in a group on a homework assignment, and allowing a tutor, TA, or another individual to write an answer for you. It is also considered academic dishonesty if you click someone else’s iClicker with the intent of answering for that student, whether for a quiz, exam, or class participation. Academic dishonesty is unacceptable, and penalties range from a letter grade drop to expulsion from the university; cases are handled via the official student conduct process described at https://dos.uic.edu/conductforstudents.shtml.

More products