Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JUnit5 から Kotest へ
Search
Daisuke Garaike
July 10, 2024
0
170
JUnit5 から Kotest へ
Daisuke Garaike
July 10, 2024
Tweet
Share
More Decks by Daisuke Garaike
See All by Daisuke Garaike
Spring Boot と AWS S3 を使ったアプリケーションのテスト
contour_gara
0
23
ノート PC に Linux 入れてみたけど結構良かった
contour_gara
0
2.8k
社外での学びを社内に還元したい
contour_gara
1
440
2 週間で Twitter Bot を作ってみた
contour_gara
0
1.2k
Database Rider を用いたデータベーステスト
contour_gara
0
400
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.9k
Unsuck your backbone
ammeep
671
58k
GraphQLとの向き合い方2022年版
quramy
49
14k
Rails Girls Zürich Keynote
gr2m
95
14k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
530
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
47
9.6k
How GitHub (no longer) Works
holman
314
140k
Visualization
eitanlees
146
16k
Faster Mobile Websites
deanohume
308
31k
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