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
700
cookpad.apk#4
ksfee684
0
730
Testing in weekly release
ksfee684
0
910
UI テストで楽するための技術
ksfee684
0
540
Espresso Driver を用いた Appium テストとその仕組み
ksfee684
0
6.9k
Other Decks in Technology
See All in Technology
JAWSコミュニティに 参加して1年経った結果
ssakita
0
120
バックオフィスに染み出すTypeScript ── clasp で安全に仕組みを作る
nealle
1
200
Kiro 入門 (1 つのエージェントを、どの画面からでも) | 目指せ Kiro マスター 01
inariku
PRO
6
1.4k
HQ駆動開発で最高のAI-Contextを作ろう
sansantech
PRO
1
120
新卒エンジニア、 介護士になる
ryu1013
1
690
Copilot Coworkで「みのるん式」やってみた
minorun365
PRO
2
1.7k
IBC 2026 動画技術関連レポート / IBC 2026 Report
cyberagentdevelopers
PRO
2
450
cdkd (CDK Direct)
gotok365
4
280
[JAWS Festa 2026]一番いい仕事は、請求書に現れない / jawsfesta2026
sh_fk2
2
430
自治体AIコンタクトセンター、何をどこに任せる?~Amazon Connect Customer +Amazon Bedrockの実践知~ / 20261107 Satoshi Torano
shift_evolve
PRO
1
130
仕様と現実の間で落とし所を探るリモートMCPの認証・認可 — Sansanの認証基盤における課題と実践
sansantech
PRO
2
220
Active Directory と Entra ID のむむむな関係
murachiakira
PRO
4
1.7k
Featured
See All Featured
Writing Fast Ruby
sferik
630
63k
Mind Mapping
helmedeiros
1
440
It's Worth the Effort
3n
188
29k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Leo the Paperboy
mayatellez
10
2.4k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
590
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
570
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
800
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 がうまく動かない •スタックトレースがわかりにくい