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
モックフレームワーク比較 / Mocking Framework Comparison
Search
Jierong Li
August 20, 2020
Programming
0
520
モックフレームワーク比較 / Mocking Framework Comparison
Jierong Li
August 20, 2020
Tweet
Share
More Decks by Jierong Li
See All by Jierong Li
一般的な通信でも使える バックグラウンドURLSessionの活用方法 / How to use background URLSession for general network data transfer tasks.
myihsan
0
2.3k
Multi-Module 101
myihsan
0
340
Hierarchical Structure について / About Hierarchical Structure
myihsan
1
500
What’s New in Accessibility WWDC21
myihsan
1
300
Property WrapperでDecodableのデフォルト値を設定 / Providing Default Value for Decodable Property by Property Wrapper
myihsan
1
290
Other Decks in Programming
See All in Programming
PHPでWebSocketサーバーを実装しよう2025
kubotak
0
270
PHPで始める振る舞い駆動開発(Behaviour-Driven Development)
ohmori_yusuke
2
330
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
250
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
660
『自分のデータだけ見せたい!』を叶える──Laravel × Casbin で複雑権限をスッキリ解きほぐす 25 分
akitotsukahara
2
620
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
280
XP, Testing and ninja testing
m_seki
3
230
第9回 情シス転職ミートアップ 株式会社IVRy(アイブリー)の紹介
ivry_presentationmaterials
1
270
Discover Metal 4
rei315
2
120
GraphRAGの仕組みまるわかり
tosuri13
8
530
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
130
WebViewの現在地 - SwiftUI時代のWebKit - / The Current State Of WebView
marcy731
0
110
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Agile that works and the tools we love
rasmusluckow
329
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
GraphQLとの向き合い方2022年版
quramy
49
14k
How to Ace a Technical Interview
jacobian
277
23k
Building Applications with DynamoDB
mza
95
6.5k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
950
Transcript
YUMEMI.swift #9 モックフレームワーク⽐較 適切なツールを使いテストを楽にしよう
Jierong Li (李) • 株式会社ゆめみ • iOSエンジニア • 趣味でAndroidとFlutter開発 •
永遠にリリースできず個⼈開発 • https://jierong.dev ⾃⼰紹介
• ⼊⼿しにくい(できない) • テストで使いたい結果を返さな い • 実⾏に時間がかかるなどの、望 ましくない副作⽤がある • 出⼒を検証しにくい(できな
い) なぜモック
⽐較するフレームワーク ステータス ⭐ 初回リリース⽇ バージョン Mockolo 288 2019年9⽉ 1.2.4 Cuckoo
1.3k 2016年1⽉ 1.4.1 Mockingbird 211 2019年8⽉ 0.14.1
⽐較するフレームワーク 分類 • ⾃作⾵ • Mockolo • Mockito⾵ • Cuckoo
• Mockingbird
Mockolo ⾃作⾵ • 単純なコード⽣成 • 導⼊簡単 • 取り除きも簡単 • 機能不⾜
Cuckoo・Mockingbird Mockito⾵
ソース指定 • Mockolo:ディレクトリー/ファイル+サフィックス排除+ノーテーション • Cuckoo:ファイル/グロブ(gub)パターン • Mockingbird:ターゲット+個別排排除 • 共通: f
i nal class
ソース指定 Mockolo • --sourcedirs • --source f i les •
--exclude-su f f i xes • --annotation
ソース指定 Cuckoo • ファイルベース • --glob • *、?、などのワイルドカードでファイル名のセットを指定
ソース指定 Mockingbird • --targets • .mockingbird-ignore • 対策 • ⽣成スピード:キャッシュ
• ビルドスピード:Thunk Stubs
• 暗黙的にデフォルト実装が使わ れ、無効なテストが作る恐れが ある • ないとテストで実⾏されるとこ ろ全部スタブする必要がある デフォルト実装
スタブシーケンス
引数チェック 実装
引数チェック テスト
実⾏順番
予想外のコール 余計なことしないのも⼤事
まとめ Mockolo Cuckoo Mockingbird 依存性 低い ⾼い ⾼い ソース指定 ホワイトリスト
ホワイトリスト ブラックリスト デフォルト実装 デフォルトオン デフォルトオフ デフォルトオフ スタブシーケンス × ◦ ◦ 引数チェック △ ◦ ◦ 実⾏順番 × × ◦ 予想外のコール × ◦ △ Objective-C サポート × ◦ × 既存問題 ? 2+件 ?
既存問題 Cuckoo
Thanks!
参考 • Mockolo • Cuckoo • Mockingbird • テストダブル -
Wikipedia • グロブ - Wikipedia