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.9k
事業支援というお仕事
seto_hi
0
420
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.8k
CoordinatorLayoutのBehaviorを使い倒す
seto_hi
1
410
Jetpack Compose
seto_hi
2
810
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.7k
MDCのButtonのCorner Family
seto_hi
1
200
MDCのBottomAppBarのShadowの実現方法
seto_hi
0
990
Other Decks in Technology
See All in Technology
ソースを読む時の思考プロセスの例-MkDocs
sat
PRO
1
360
OPENLOGI Company Profile for engineer
hr01
1
46k
re:Invent 2025の見どころと便利アイテムをご紹介 / Highlights and Useful Items for re:Invent 2025
yuj1osm
0
650
AIでデータ活用を加速させる取り組み / Leveraging AI to accelerate data utilization
okiyuki99
6
1.7k
Observability — Extending Into Incident Response
nari_ex
2
740
DMMの検索システムをSolrからElasticCloudに移行した話
hmaa_ryo
0
350
ゼロコード計装導入後のカスタム計装でさらに可観測性を高めよう
sansantech
PRO
1
670
Digitization部 紹介資料
sansan33
PRO
1
5.8k
次世代のメールプロトコルの斜め読み
hirachan
3
330
[Journal club] Thinking in Space: How Multimodal Large Language Models See, Remember, and Recall Spaces
keio_smilab
PRO
0
110
LLM APIを2年間本番運用して苦労した話
ivry_presentationmaterials
9
4.3k
アノテーション作業書作成のGood Practice
cierpa0905
PRO
1
380
Featured
See All Featured
For a Future-Friendly Web
brad_frost
180
10k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
640
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Automating Front-end Workflow
addyosmani
1371
200k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
It's Worth the Effort
3n
187
28k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
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できる