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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Jierong Li
August 20, 2020
Programming
0
540
モックフレームワーク比較 / 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.8k
Multi-Module 101
myihsan
0
350
Hierarchical Structure について / About Hierarchical Structure
myihsan
1
510
What’s New in Accessibility WWDC21
myihsan
1
330
Property WrapperでDecodableのデフォルト値を設定 / Providing Default Value for Decodable Property by Property Wrapper
myihsan
1
320
Other Decks in Programming
See All in Programming
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
250
The Ralph Wiggum Loop: First Principles of Autonomous Development
sembayui
0
3.7k
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
750
TipKitTips
ktcryomm
0
160
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
210
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
540
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
160
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
490
株式会社 Sun terras カンパニーデック
sunterras
0
2k
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
710
2026/02/04 AIキャラクター人格の実装論 口 調の模倣から、コンテキスト制御による 『思想』と『行動』の創発へ
sr2mg4
0
720
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
380
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
600
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Navigating Team Friction
lara
192
16k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
81
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
190
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
Designing Powerful Visuals for Engaging Learning
tmiket
0
260
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