In the early years of my career, getting started with testing my code felt like trying to break through a brick wall. To hopefully make your experience less painful, here is an attempt at the introduction I was given to this important topic.
In this article, you will learn how to write code which is easily testable and how to test it using a single tool: JUnit 5.
- Java Development Kit (JDK) version 8 or newer.
- JUnit 5.8.2 (though most versions of JUnit 5 should work).
- An IDE with JUnit integration is recommended, such as Eclipse, Intellij IDEA, Android Studio, NetBeans. This article will make references to IntelliJ IDEA.
- A build tool is recommended, such as Gradle or Maven to manage the JUnit 5 dependency.
Why You Should Care About Testing
Anytime you write application code that is deployed and used, it is being tested. Whether you …