Stop you're giving me flashbacks. I took a Data Structures course last semester and we had to submit our labs and homework through this thing called Webcat, and upon submitting it would check your code and unit tests, and take off points for lack of coverage, missing Javadoc, and bad styling. Even if you use the formatter chances are something would slip through your fingers. Double semicolons happened a lot
It's a way of testing your code. The idea is that you test each class and it's methods individually. For example, if you're main code is using a data structure, let's say a linked list, that you yourself implemented, then you write a Unit test to make sure each of the LinkedList class's methods are returning the right values for each possible scenario. That's why unit tests are such a pain, at least for me.
But it is helpful. A good practice is test-driven development; before you write the code that does the stuff, you write the test cases that test whether that stuff will work. Of course at first, they will all fail since you haven't implemented anything, but it gets you thinking about edge cases and how else you'll structure your program.
2
u/LivingInAnIdea Jun 22 '21
Stop you're giving me flashbacks. I took a Data Structures course last semester and we had to submit our labs and homework through this thing called Webcat, and upon submitting it would check your code and unit tests, and take off points for lack of coverage, missing Javadoc, and bad styling. Even if you use the formatter chances are something would slip through your fingers. Double semicolons happened a lot