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
ノハナ ノ テスト ノ ハナシ
Search
HiroYUKI Seto
May 10, 2017
Technology
1
2k
ノハナ ノ テスト ノ ハナシ
2017/5/10
Android Testing Bootcamp #6
HiroYUKI Seto
May 10, 2017
Tweet
Share
More Decks by HiroYUKI Seto
See All by HiroYUKI Seto
Androidアプリの 安全なリファクタリングを行うパターン集
seto_hi
2
4.9k
UI TestやVisual Regression Testを コスパ良くやる
seto_hi
3
1.8k
事業支援というお仕事
seto_hi
0
410
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.8k
CoordinatorLayoutのBehaviorを使い倒す
seto_hi
1
390
Jetpack Compose
seto_hi
2
770
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.7k
MDCのButtonのCorner Family
seto_hi
1
180
MDCのBottomAppBarのShadowの実現方法
seto_hi
0
970
Other Decks in Technology
See All in Technology
Securing your Lambda 101
chillzprezi
0
240
本部長の代わりに提案書レビュー! KDDI営業が毎日使うAIエージェント「A-BOSS」開発秘話
minorun365
PRO
13
1.6k
Workflows から Agents へ ~ 生成 AI アプリの成長過程とアプローチ~
belongadmin
2
140
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
上長や社内ステークホルダーに対する解像度を上げて、より良い補完関係を築く方法 / How-to-increase-resolution-and-build-better-complementary-relationships-with-your-bosses-and-internal-stakeholders
madoxten
13
7.4k
SFTPコンテナからファイルをダウンロードする
dip
0
110
今からでも間に合う! 生成AI「RAG」再入門 / Re-introduction to RAG in Generative AI
hideakiaoyagi
1
160
Tensix Core アーキテクチャ解説
tenstorrent_japan
0
350
Cloud Native Scalability for Internal Developer Platforms
hhiroshell
2
430
AWS と定理証明 〜ポリシー言語 Cedar 開発の舞台裏〜 #fp_matsuri / FP Matsuri 2025
ytaka23
9
2.4k
IAMのマニアックな話 2025を執筆して、 見えてきたAWSアカウント管理の現在
nrinetcom
PRO
3
520
vLLM meetup Tokyo
jpishikawa
1
200
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
106
19k
Building Applications with DynamoDB
mza
95
6.4k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
Six Lessons from altMBA
skipperchong
28
3.8k
Making Projects Easy
brettharned
116
6.2k
It's Worth the Effort
3n
184
28k
Code Review Best Practice
trishagee
68
18k
Unsuck your backbone
ammeep
671
58k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Docker and Python
trallard
44
3.4k
Transcript
ノハナ ノ テスト ノ ハナシ Android Testing Bootcamp #6 株式会社ノハナ
瀬戸優之 @seto_hi
None
自己紹介 • 瀬戸優之 せとひろゆき @seto_hi • 株式会社ノハナ ◦ 唯一のAndroidエンジニア ◦
UIデザインもやる、施策も考える、なんでもやる ◦ 絶賛採用中 • 好きなAPIはCanvas#saveとViewGroup#layout
ノハナのテスト事情 • 100% Kotlin! • Unit test >>> Instrumented Test
◦ Unit testはenumが中心 ◦ Instrumented Test は古いテストが多め • CIはTravisを利用 • UIテストなし ◦ QAで保証
ノハナのテスト環境(3月) • PR投げるとTravis CIがまわる ◦ Instrumented Test + Unit test
◦ 1回15〜20分 • テストが通らないとPRをマージしない厳密なルール ◦ 毎回PRが20分待ち.. • 遅すぎる • Instrumented Test 遅すぎる
Travis Cron Jobs • Beta Feature • 特定ブランチのスクリプトを定期実行してくれる ◦ 毎日、毎週、毎月の3パターン
• PRと別のコマンドを実行できる
Travis Cron Jobs
ノハナのテスト環境(4月) • PR投げるとTravis CIがまわる ◦ Unit testのみ ◦ 1回5分 •
Travis Cron Jobsで毎日Instrumented Testが走る ◦ 1回18〜22分 • 待ち時間大幅削減
None
Robolectric Custom Shadow
Robolectric Custom Shadow • Shadow = 実行時のクラス差し替え • staticメソッドでもmockできる •
Custom Shadowの作り方が簡単になっていた • http://robolectric.org/custom-shadows/
Robolectric Custom Shadow 作り方 1. @implements{Hoge.class}をつけたクラスを作る
Robolectric Custom Shadow 作り方 2. @Implementationをつけたメソッドを作る
Robolectric Custom Shadow 作り方 3. テストクラスに@Config(shadows={ShadowHoge.class}) をつける
None
まとめ • テストの重み付けをしよう ◦ 軽いテスト、重要なテストは毎回実行 ◦ 重いテスト、重要でないテストは定期実行 ▪ Travis Cron
Jobs便利 • RobolectricのCustom Shadowはサクッと作れる ◦ staticメソッドもmockできる