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
Android における UI テスト設計戦略
Search
Kyohei Kato
February 20, 2019
Technology
1.2k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android における UI テスト設計戦略
Kyohei Kato
February 20, 2019
More Decks by Kyohei Kato
See All by Kyohei Kato
After Party DroidKaigi 2021
ksfee684
0
610
cookpad-summer-internship-2020-android
ksfee684
0
8.3k
cookpad.apk#5
ksfee684
0
690
cookpad.apk#4
ksfee684
0
730
Testing in weekly release
ksfee684
0
900
UI テストで楽するための技術
ksfee684
0
540
Espresso Driver を用いた Appium テストとその仕組み
ksfee684
0
6.9k
Other Decks in Technology
See All in Technology
Meet AgentCore Identity Consent Portal
hironobuiga
3
190
調査タスクをAIと乗り切る 〜過去の調査をナレッジ化し 調査手順をスキルにする〜
mot_techtalk
1
100
個別開発で終わらせない。 現場の課題をプロダクトの強さに変える StockmarkのFDE
ktkrhr
0
580
Snowflake Horizon Catalog と Apache Iceberg で作る オープンなデータ基盤
kitagawaz
0
420
[2026 Oracle Technical Deep Dive] オンプレミスDBのCloud移行アプローチ:移行計画に基づくメソッドとツールの選択 (2026年9月17日開催)
oracle4engineer
PRO
0
130
オンラインゲームのシステム全体像 - コロプラ 2026年度 新卒研修
colopl
0
340
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
490
インバスケット試験対策アプリを 作って見えたAIエージェント構築 ナレッジ2選
shichijoyuhi
1
120
20260929_AmazonGuardDutyの検出通知メールにAWS DevOpsAgentの調査結果を追加する
yhana
1
450
予測不能な実行エージェントを安全にサクッと試せるサンドボックス環境の話
sansantech
PRO
0
110
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
1
400
スキルを作る、その前に!複数人で使われるスキルを 作るためのプロセス
junkifurukawa
2
220
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
450
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
270
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Practical Orchestrator
shlominoach
192
12k
Utilizing Notion as your number one productivity tool
mfonobong
4
610
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
450
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
570
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
460
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
710
Bash Introduction
62gerente
615
220k
Transcript
Android における UI テスト設計戦略 Android / iOS Test Night 番外編
自己紹介 •加藤恭平(ksfee684) ‣クックパッド株式会社 技術部品質向上グループ ‣ レシピサービスアプリで UI テストなどを担当 ‣おすすめは M:tG
Android における UI テスト設計戦略
None
Kotlin を活用した いい感じの DSL による いい感じの Espresso Test
対象者 •ざっくりとした Kotlin 言語に関する知識 •ざっくりと Espresso の API に関する知識
背景 •Espresso を利用したテストを実装する環境が整ってい ない •Espresso を直に利用するのはちょっと… •テストケースをリーダブルにしつつ、裏の実装も簡単 にしたい
Robot Pattern •Jake が発表した Instrument Test 実装パターン ‣ Kotlin 言語をうまく活用
‣ https://academy.realm.io/posts/kau-jake-wharton- testing-robots/ •Page Object Pattern ライク
Robot Pattern PaymentRobot payment = new PaymentRobot(); ResultRobot result =
payment .amount(42_00) .recipient("
[email protected]
") .send(); result.isSuccess();
Robot Pattern payment { amount(4200) recipient("
[email protected]
") } send { isSuccessful()
}
もうちょっと欲張る •すべての操作に対してアサーションを挿入可能に •Kotlin の DSL に形式にもう少し従って
Kotlin を活用した いい感じの DSL による いい感じの Espresso Test
Scope Pattern
Scope Pattern •Robot Pattern を拡張 •各画面を Scope として定義 •各操作はアサーションと基本的にセット ‣
アサーションブロックを受け取る ‣ ネストするコマンドも存在している
Scope Pattern
各画面を Scope として定義
各画面を Scope として定義 •StepScope と ResultScope(e.g RecipeEditStepScope) •テストケースはシングルエントリーポイントから RootScope 下で実行される
•各 Scope(画面)は RootScope の拡張関数として定義 •Scope 自身をレシーバとするラムダ関数を引数として受 け取る
各画面を Scope として定義
各画面を Scope として定義
各画面を Scope として定義
操作はアサーションとセット
操作はアサーションとセット
操作はアサーションとセット
ネストする操作
ネストする操作
ネストする操作
まだまだこれから •DslMarker がうまく動かない •スタックトレースがわかりにくい