Question: You will write some unit test to test the provided code here: please, please, please, and please!!! and answer the above question. First file: Second






Objectives: 1. You will get some experience with using a debugger and fixing bad code. 2. You will write some unit tests to test the provided code. 3. You will learn about the Observer pattem. Additional Preparation You will need to use an IDE this assessment. If you are using Eclipse, then JUnit 5 is installed. I will start a discussion thread with what I did to install these components into Java. Write Unit Tests . . Write unit tests using JUnit for the DiceBag class. Write the following unit tests: Add an Order Die to the DiceBag. Verify that the Order Die object is in the DiceBag! Test the toString method of the DiceBag class. Verify that the returned string is correct! Add 3 blue Order Die object and add 2 red Order Die objects. Verify that those 5 Order Die objects are in the DiceBag! Fix the Code! Use the Java debugger to find bugs in the given code. Document the bugs that you found in the above files HW Report The first draft of my code for the DiceDraw app will be in the following code. You will create the hw6 package in your IDE, and move the code files into the hw6 package. Make sure that the application compiles and runs. Next, use JUnit to write unit tests described above. Fix any coding errors that you find. You are free to change the code to make it easier to test, but no data member may be made public'. are expected to find out why player "Steve' gets assigned all the dice that are drawn. Fix the coding errors so that the order dice are drawn and assigned to the correct player. Answer these questions: 1. How many bugs did you find in the unit testing? What were they? 2. Did you find any bugs when using the debugger? What were they? 3. Are there any unit tests that could have found the bugs you found in the debugger? Describe one of those tests. I package hw6; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadLocalRandom; // This class holds the dice(or tokens) to be drawn. // public class DiceBag { private List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
