OSS探訪

spec style・assertion・property testingをKotlinのtest codeへまとめる

スコアの見方

OSS規模スコアはStars・Watchers・Forks・Contributorsを対数圧縮して重み付けした現在の規模指標(上限なし)です。発掘スコアは現在のOSS規模スコアから発掘時点のOSS規模スコアを引いた値、更新ペースは直近30日Commit数、成長モメンタムは直近の観測期間におけるOSS規模スコア差、OSS健全度は取得できた更新状況・Community Health・Releaseの0〜100評価です。

Stars
4,789
主要言語
Kotlin
ライセンス
Apache-2.0
リポジトリ最終更新
2026/09/28
ページ内ナビ

概要

KotestはKotlin向けのtesting frameworkで、複数のspec style、豊富なmatcher、property testing、data-driven testを一つのecosystemで提供します。JVMではJUnit Platformと統合し、Kotlin/JS・Native・Wasmを含むMultiplatform向け構成も用意されています。

特徴と向いている用途

公式資料に基づく紹介・実機未検証 · 内容確認日:

主な特徴

複数のspec styleとmatcherでKotlinらしいtestを記述する

FunSpecやStringSpec等のspec styleを選び、shouldBe等のmatcherでassertionを記述できます。test structureとassertionを同じlibrary群で揃えられます。

出典:[2][3]

property testingとMultiplatformへ同じecosystemを広げる

kotest-propertyを追加するとgeneratorとshrinkingを使ったproperty testingができ、JS・Native・Wasm向けにはframework engineとKSP/Gradle pluginを組み合わせます。

出典:[3]

向いている用途

Kotlin projectでtest styleとassertionを一貫させたい場合に向く

unit testからproperty testまで共通のDSLとmatcherへ寄せ、JVMとMultiplatformでtest設計を揃えたいteamに向きます。

出典:[2][3]

導入前の確認

6.2.5のmodule versionを揃える

runner、assertions、property等のKotest moduleは同じ6.2.5へ揃えます。異なるmajor/minorを混在させるとruntime互換性問題の原因になります。

出典:[3][4]

Kotest 6.xのtoolchain要件を先に確認する

公式setup referenceはKotlin 2.2以上、JDK 11以上、Gradle 8.0以上を最低要件として示しています。JS・Native・WasmではKSPも必要です。

出典:[3]

参考にした公式資料

  1. [1]kotest/kotest repository(2026-09-30)
  2. [2]Kotest README(2026-09-30)
  3. [3]Kotest 6.2.5 setup reference(2026-09-30)
  4. [4]Kotest v6.2.5 release(2026-09-30)
  5. [5]Kotest Apache 2.0 license(2026-09-30)
編集部からの補足

Kotest 6.2.5はKotlin向けの総合testing frameworkです。JVMではJUnit Platform runnerとassertionを組み合わせ、必要に応じてproperty testingを追加できます。6.xはKotlin 2.2以上・JDK 11以上・Gradle 8以上が基準なので、既存projectのtoolchain確認が先です。

3ステップで試す

  1. 1

    Kotest 6.2.5のrunnerとassertionを追加

    JVM projectへrunnerとmatcherを同じversionで追加し、Gradle test taskではuseJUnitPlatform()を有効にします。

    testImplementation("io.kotest:kotest-runner-junit5:6.2.5") testImplementation("io.kotest:kotest-assertions-core:6.2.5")
  2. 2

    StringSpecを1件作成

    io.kotest.core.spec.style.StringSpecとio.kotest.matchers.shouldBeをimportして最小testを作ります。

    class MathTest : StringSpec({ "1 + 1" { 1 + 1 shouldBe 2 } })
  3. 3

    test taskを実行

    JUnit Platform経由でKotest specが検出・実行されることを確認します。

    ./gradlew test
公式READMEで確認

成長

成長の推移 · 直近30日

4,789 Stars

推移データを蓄積中です。

Built with

カテゴリとタグ

GitHubデータ

GitHubのデータGitHubの詳細データを見る

GitHub Topics

  • assertions
  • kotlin
  • kotlin-js
  • kotlin-multiplatform
  • matchers
  • multiplatform
  • property-testing
  • test
  • testing
  • testing-tools
Stars
4,789
Forks
703
Watchers
51
Open Issues
49
所有者種別
Organization
主要言語
Kotlin
ライセンス
Apache-2.0
リポジトリ最終更新
2026/09/28

このOSSの使い方や活用事例をMarkdownで投稿できます。管理者が承認した後に公開されます。

情報の誤りを報告

掲載内容に誤りや古い情報があればお知らせください。

このページを読んで、次に何をすればよいか分かりましたか?