$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JUnit5 から Kotest へ
Search
Daisuke Garaike
July 10, 2024
0
190
JUnit5 から Kotest へ
Daisuke Garaike
July 10, 2024
Tweet
Share
More Decks by Daisuke Garaike
See All by Daisuke Garaike
AR グラス + ミニ PC で実現する新しいモバイル環境
contour_gara
0
210
TDD 実践ミニトーク
contour_gara
1
350
Spring Boot と AWS S3 を使ったアプリケーションのテスト
contour_gara
0
79
ノート PC に Linux 入れてみたけど結構良かった
contour_gara
0
3.2k
社外での学びを社内に還元したい
contour_gara
1
480
2 週間で Twitter Bot を作ってみた
contour_gara
0
1.2k
Database Rider を用いたデータベーステスト
contour_gara
0
440
Featured
See All Featured
Tell your own story through comics
letsgokoyo
0
740
What the history of the web can teach us about the future of AI
inesmontani
PRO
0
360
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.7k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
130
Exploring anti-patterns in Rails
aemeredith
2
200
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
86
Information Architects: The Missing Link in Design Systems
soysaucechin
0
700
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
16
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
180
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
170
Un-Boring Meetings
codingconduct
0
160
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
Transcript
JUnit5 から Kotest へ 2024-05-10 Kotlin Fest アフターパーティー@コドモン Daisuke Garaike
自己紹介 gara Twitter: @contour_gara GitHub: contour-gara Java で百貨店システムの開発 業務外では Kotlin
2
印象に残ったセッション Kotest を使ってみる! 3
Spec は WordSpec に テスト名を仕組みとして決めることができる。 保存メソッドの場合 4
リポジトリのテスト インフラ プレゼン ユースケース ドメイン DB H2 コンテナ ローカル 開発生産性の観点から考える自動テスト(2024/06版)
より https://speakerdeck.com/twada/automated-test-knowledge-f rom-savanna-202406-findy-dev-prod-con-edition?slide=32 5 モック DB
データ投入 & テーブルのアサーションライブラリ Database Rider • アノテーション • データ投入 ◦
YAML ファイルで 定義 ◦ 実行前にデータ削除 • テーブルアサーション • Kotest では 使用できない DbSeup • コード • データ投入 • データ削除 AssertJ-DB • コード • テーブルアサーション 6
データ投入 7
テーブルアサーション 8
データ削除 9 テスト・ケースの実行前にデータの後始末を行う 単体テストの考え方/使い方 p. 350 DbSetup ユーザーガイドでも、空のデータベースから 始めて最後に消すことを否定している。 https://dbsetup.ninja-squad.com/user-guide.html
まとめ • Kotest へ移行することでテスト名に一貫性をもたせる ことができた。 • Kotest でもリポジトリのテストはできた。 ◦ みなさんのリポジトリテストを教えてほしいです。
参考: https://github.com/contour-gara/gara-photo-spring-boot 10