Blog
Unit Tests for Concurrent Java with VMLens (on Baeldung)
While it is common to write unit tests for single-threaded Java, unit tests for concurrent Java are still rarely used. By using VMLens, an open source tool to deterministically unit test concurrent Java, we can now change this. In the following tutorial, we’ll learn how to use VMLens to write unit tests for concurrent Java.
August 31, 2025
How to test multi-threaded and concurrent Java
In the following tutorial, I will show you how to use VMLens with a simple example. We will build a concurrent Address class that holds a street and a city. The class should support parallel reading and writing from multiple threads.
June 10, 2025
A new way to test multi-threaded and concurrent Java
Testing multi-threaded, concurrent Java is hard since we can only test one thread interleaving at a time. An obvious solution is to repeat the test multiple times, hoping that we execute all possible interleavings. The problem with this solution is that every field access leads to a potential new interleaving. So the solution only works for small unit tests. This led me to develop the open-source tool VMLens.
June 5, 2025