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
620
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
分析AIエージェントを育てる、動く環境を育てる
codatum
1
1.1k
V8のArray.prototype.flatを最大約20倍速くするまでと、巨大OSSへの大規模コミットの道のり
riyaamemiya
0
290
Running Kotlin + Quarkus with Lambda
nealle
1
3.7k
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
190
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
100
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
190
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
4
1.4k
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
770
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
2.4k
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
250
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
300
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
4
1k
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Being A Developer After 40
akosma
92
590k
Claude Code のすすめ
schroneko
67
230k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
New Earth Scene 8
popppiees
4
2.7k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Utilizing Notion as your number one productivity tool
mfonobong
4
620
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
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 がうまく動かない •スタックトレースがわかりにくい