Kotest VS spek

Compare Kotest vs spek and see what are their differences.

Kotest

Powerful, elegant and flexible test framework for Kotlin with assertions, property testing and data driven tests. (by kotest)

spek

A specification framework for Kotlin (by spekframework)
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
Kotest spek
17 2
4,461 2,227
0.5% 0.1%
9.7 0.0
8 days ago 6 months ago
Kotlin Kotlin
Apache License 2.0 GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Kotest

Posts with mentions or reviews of Kotest. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-29.
  • AocKt: Test-driven Advent of Code in Kotlin
    3 projects | /r/Kotlin | 29 Nov 2023
    As you might know, Advent of Code will begin this Friday! If, like me, you want to have a go at solving the puzzles in Kotlin, I would like to share with you a little library I've developed to reduce boilerplate and solve the puzzles in a test-driven approach. It is based on Kotest, a modern and Kotlin-first test framework.
  • Tests Everywhere - Kotlin
    4 projects | dev.to | 23 Nov 2023
    Kotlin testing with Kotest and MockK
  • Best practices for Unit Testing Android Apps with Mockk, Kotest and others
    5 projects | dev.to | 10 May 2023
    As a matter of fact, in the previous examples, we have shifted a bit away from the TDD standards in the meaning that we test not only the operability of our code, but rather check if the code runs according to certain specifications (Given/When/Then). These specifications are our tests, and the syntactic sugar in the form of the possibility to give clear names to the tests using DisplayName and the grouping of the tests by a set of similar attributes helps us clearly formulate these specifications. There is an entire family of frameworks in different languages that allow us to create such specifications: for Java it is Spock, for Ruby—RSpec, and for Kotlin—Spek and Kotest frameworks. Below, I will go into more detail about them.
  • Why do Kotlin tests (for Gradle projects) have to be inside classes?
    1 project | /r/Kotlin | 28 Jan 2023
  • Kotlin Mutation Tests
    1 project | /r/Kotlin | 25 Jan 2023
    I've tried so many times. SO MANY. I love the idea of mutation testing. Even chatGPT couldn't help me. It just made up fake mutation testing frameworks to try. To me, pitest is dead. kotest is not mutation testing, but it's property testing is the next best thing I have found to revolutionize your unit tests.
  • How to improve third-party libraries with Kotlin extensions
    2 projects | dev.to | 6 Dec 2022
    The extensions are not particularly useful in this scenario because the described functionality can be incorporated into the Host class. On the other hand, they flourish in test frameworks like Kotest and enable the rapid development of useful add-ons like custom matchers. Extending third-party libraries with utility functions is another prevalent use case. In the next sections, we'll zero in on this specific aspect.
  • Are there any plans to make a better build system for Kotlin than Gradle?
    4 projects | /r/Kotlin | 17 Sep 2022
  • Testing with fakes different states?
    1 project | /r/androiddev | 3 Aug 2022
    We're using Kotest for our unit tests and are quite happy with it.
  • Testing with Kotlin and JUnit5
    2 projects | dev.to | 10 Jun 2022
    Basic testing in Kotlin with Kotest built for kotlin specificatlly (upcoming)
  • Kotlin&Junit vs Groovy&Spock
    1 project | /r/Kotlin | 5 May 2022
    Here you are: https://github.com/kotest/kotest/issues/189

spek

Posts with mentions or reviews of spek. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-10-22.
  • Evolution of unit tests in Android
    3 projects | dev.to | 22 Oct 2023
    Spek is a unit testing framework for Kotlin which supports Specification and Gherkin style.
  • Best practices for Unit Testing Android Apps with Mockk, Kotest and others
    5 projects | dev.to | 10 May 2023
    The describe-it style is mainly used to write Spek tests. describe structure allows us to create a group of tests describing a specific method, and, in it, a specific scenario for the method is written. But it is also possible to use the GivenWhenThen style. Unfortunately, the framework doesn’t have embedded coroutine support, so we have to always use runBlockingTest { } for suspended functions. There is a ticket with this feature request on Github, but it seems it was never completed.

What are some alternatives?

When comparing Kotest and spek you can also consider the following projects:

mockk - mocking library for Kotlin

Kluent - Fluent Assertion-Library for Kotlin

expekt - BDD assertion library for Kotlin

strikt - An assertion library for Kotlin

mockito-kotlin - Using Mockito with Kotlin

hamkrest - Hamcrest for Kotlin

balin - Balin is an automation library for Kotlin. It's basically a Selenium-WebDriver wrapper inspired by Geb.

aspen - Aspen is a simple test runner for Kotlin that allows you to write tests using your own DSL.

atrium - A multiplatform expectation library for Kotlin

kspec - Kotlin Specification Framework

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured

Did you konow that Kotlin is
the 16th most popular programming language
based on number of metions?