top of page

Value of Testing: JUnit


For my first blogpost, I decided to start off with a blog from codecentric. The blogpost that I decided to read and write about was by Tobias Goeschel that focuses on the importance of testing, and how implementing well written testing through JUnit. One of the most important things about testing is that is allows someone to be able to add new features to their code without breaking what is already in place. This means helping to make changes to the architecture without damaging the behavior which in hand helps them find bugs earlier on. Some of the main things that well written tests help with are how to access API, what kind of data goes in & out and what happens to certain exceptions that occur. A form of living documentation is the value of tests and it helps when revisiting old code, seeing someone elses and looking for bugs. JUnit is known as the most popular form of testing, which is a Java version of SUnit. Although JUnit has a lot of pros, there are some cons to it. One of them being that it doesn’t help with documentation, which i did not know about at all. This means that there is no manual on how big or small each case should be. It instead offers templates. They may sound nice but they do not take into account the different kinds of classes and how they react within its different surroundings. This is no good because others will not be able to understand what is going on. One of the most important things that we can do is to give the same care that was given to our production code to our test code. This means constant refactoring, removing duplicates, having short and readable methods and leaving only if necessary comments. The rest of the article goes in depth on the different measures and precautions that can be taken when applying specifically to testing. This is honestly the first time that I am actually taking a look into testing. I have worked on it when need be in my other programming classes, but have never fully understood the importance, what specifically should be done and the different things that can be done when it comes to testing. This article was the easiest to understand out of the testing articles that I had looked into. The way Groeschel wrote about testing and specifically JUnit testing, was very simplified and I felt I did not have to go over sentences too much to understand what he was trying to convey. I cannot say if I agree or disagree with a lot of what he said just because this is such a new subject matter for me, especially when he starts to talk about JUnit but i felt like a lot of what he said seemed to have made sense. I am excited to see what JUnit has in store for me this semester.

bottom of page