Testing

JUnit 5 Maven Example: Running Tests with Surefire

In this JUnit 5 Maven example, we will learn how to get the required dependencies for writing JUnit 5 tests with Maven. Also, we will learn how to configure the Maven Surefire plugin to run the tests.

JUnit 5 Gradle Example

In this JUnit 5 Gradle example, we will learn how to get the required dependencies for writing JUnit 5 tests with Gradle. Also, we will learn how to configure the JUnit Gradle plugin to run the tests.

Migrating from JUnit 4 to JUnit 5: A Definitive Guide

Learn how to migrate from JUnit 4 to JUnit 5. See how to run existing tests along with the new version, and what changes are needed to migrate the code.

Testing myth #2: Unit tests are not worth it

There are a lot of developers and managers who think that writing unit tests is just extra work. Suggesting that we should write more unit tests seems to receive ill responses. I think there are many people out there who still don’t understand the purpose of unit testing. This kind of thinking is probably the result of following kind of experiences: Writing unit tests is really hard and time consuming. Even small changes in requirements keep breaking the unit tests. Unit tests are not finding any real bugs. It is not that writing unit tests is somehow fundamentally laborious. These kind of experiences are symptoms of something else.

Testing myth #1: Writing tests slows you down

Let’s assume we have decided to increase the stability of our software. So we decide to write tests for our code. The problem is that the customer is requesting new features and deadlines are approaching.