I was looking through an article called “What Is JUnit: An Overview of the Best Java Testing Framework”. The link is here: What Is JUnit: An Overview of the Best Java Testing Framework. This article introduces JUnit to its audience. First it defines JUnit which is open sourced unit testing for code in the Java language. Then it defines unit testing which is what JUnit is part of. Unit testing is defined to have the audience better understand JUnit. Although I personally would have put the unit testing definition before the definition of JUnit since it appears in JUnit’s I understand that it was done to get more traffic on the site. The article later list JUnit’s features and its annotations.
I chose this article because it related to what I have been recently learning. Also, I am new to JUnit so it would be interesting to learn more about it. In my most recent class, we were introduced to annotations which I defined as indicators for when a method should execute or is a test. Thanks to the article, I understand that an annotation can be used to ignore statements during test execution, to set some timeout while a test is executed and to handle some exception during test execution. I also learned about JUnit’s use cases. At first, I thought it only verified that the provided code worked. I now know it has a lot more uses. It tests how code behaves will null values and invalid data. It verifies that objects maintain their state throughout their lifecycles. This essentially means that it checks if objects do what they are supposed to do. It tests interactions between the tested code and the external library. It provides a safety net allowing users to not worry about regressions when modifying their code. Also, JUnit code is a cornerstone of TDD, integrate with CI pipelines and can run test legacy code. These lead to bug free and testable code. So JUnit has a lot of uses.
I also liked how the article was structured. It was simple, concise, and provided a lot of useful information as seen on the paragraph above. I only wished it gone over JUnit assertions because I am still a little confused about that. Overall, this was a very newbie friendly article.
To conclude, I this article has improved my understanding of this topic. It has also increased my interest. I look forward to learning more and using this in the future.
From the blog CS@Worcester – My Journey through Comp Sci by Joanna Presume and used with permission of the author. All other rights reserved by the author.