An exercise to review Java Fundamentals and JUnit tests.
Your goal in this assignment is to implement the missing methods and create tests for them. There are some tests that are already provided for you, but other tests you will need to write yourself.
When making a PR, GitHub should automatically run all tests. If you fail any of the unit tests or have too few tests overall, you will get a red X. If you pass all tests and have a sufficient number of tests, you will get a green checkmark.
However, please do not rely too closely on just the number of tests!!! It is used as a VERY rough check that you're doing test writing. What's important is not the exact number of tests, but instead how well your tests cover different behavior. You could have 1000 tests, but if they all test almost exactly the same thing, they may not be very helpful! Your goal is to make USEFUL tests that could catch a range of possible bugs.
So how thoroughly should you be testing then?
- You should make varied enough tests that you are reasonably confident that there is a low probability of bugs in your code.
- However, you do not need to have extreme confidence - no lives hang in the balance!
- Imagine instead that you are submitting this code for a job, and if there are bugs it will cause problems for you later. Maybe if there is a bug your boss will be unhappy or you might have to spend a weekend fixing an issue it caused for a customer.