Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
モックフレームワーク比較 / Mocking Framework Comparison
Search
Jierong Li
August 20, 2020
Programming
580
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
モックフレームワーク比較 / Mocking Framework Comparison
Jierong Li
August 20, 2020
Transcript
21 slides
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
More Decks by Jierong Li
See All by Jierong Li
一般的な通信でも使える バックグラウンドURLSessionの活用方法 / How to use background URLSession for general network data transfer tasks.
myihsan
0
3.2k
Multi-Module 101
myihsan
0
380
Hierarchical Structure について / About Hierarchical Structure
myihsan
1
550
What’s New in Accessibility WWDC21
myihsan
1
370
Property WrapperでDecodableのデフォルト値を設定 / Providing Default Value for Decodable Property by Property Wrapper
myihsan
1
400
Other Decks in Programming
See All in Programming
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
350
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
240
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
900
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
250
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.3k
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
180
LLM 101
dalinaum
0
500
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
150
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
330
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
310
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
210
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Making Projects Easy
brettharned
120
6.9k
Design in an AI World
tapps
1
390
Amusing Abliteration
ianozsvald
1
390
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
460
Ruling the World: When Life Gets Gamed
codingconduct
0
440
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Side Projects
sachag
456
43k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
880
Product Roadmaps are Hard
iamctodd
55
13k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k