Program JavaZone

Foredrag Torsdag 3. september

Spring: Spock vs. Kotest vs. JUnit - When to Pick Which One?

Room 3

Engelsk 45 min java kotlin kotest spock testing spring

Marek Dominiak

I’m a CTO of Sparkbyte Solutions, co-owner of Trainitek, and an architect and tech lead at Mintra. I have 19 years of experience, mainly in the Java world. I’ve spent a lot of time mentoring developers and leading teams, with a big focus on creating solutions that will actually last for many years. That got me into Software Craftsmanship, Domain-Driven Design, and code quality early on.

Over my career, I’ve completed many small and large projects that run in production, interviewed developers, handled communication with customers, designed architecture for entire systems and delivered them, and introduced many technologies proven in production. I have 15 years of experience working in the Scandinavian market.

Through Trainitek, I’ve trained over 650 people in modern architecture, Domain-Driven Design, EventStorming, and testing. We’ve worked with more than 40 companies so far.

I like to share what I know at conferences: Devoxx Poland, Devoxx UK, NDC Oslo, JavaZone, jPrime, JDD in Kraków, and others.

Choice of a testing framework to be used in a team is usually overlooked (let’s just take what we have used before, i.e., JUnit). However, nowadays the choice is not that obvious anymore, and the support for testing libraries like Spock and Kotest is much better than many years ago, especially in cooperation with Spring Boot. There are many gotchas you should be aware of.

Spock, Kotest, and JUnit seem to be similar, however, the devil is in the details, and those can sting hard! They differ in terms of features, complexity, flexibility, performance, integration with Spring Boot and Testcontainers, developer friendliness, and maintenance. You could be surprised that switching to another framework can slow down your tests by 30-50%. The choice is tough, and we aren’t limited to only one tool!

Come to my talk to learn key differences, gotchas that can help you to make up your mind which of the tools the best in your context.

All developers working with any JVM language

  1. Understanding Prompt Injection - Techniques, Challenges, and Advanced Escalation Room 1
  2. Kodearkeologer på legacy eventyr Room 2
  3. Stop writing Terraform: Build developer-friendly platforms with Crossplane Room 4
  4. Kotlin Coroutines in Ktor: What you need to know Room 6
  5. A Journey - On tour with Java code on it’s way through the JVM Room 7
  6. How to Git Away with Murder Room 8
  7. Generics – You Never Know What You’re Gonna Get Room 6