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
5k
UI TestやVisual Regression Testを コスパ良くやる
seto_hi
3
1.9k
事業支援というお仕事
seto_hi
0
440
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.8k
CoordinatorLayoutのBehaviorを使い倒す
seto_hi
1
440
Jetpack Compose
seto_hi
2
870
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.8k
MDCのButtonのCorner Family
seto_hi
1
240
MDCのBottomAppBarのShadowの実現方法
seto_hi
0
1k
Other Decks in Technology
See All in Technology
スピンアウト講座01_GitHub管理
overflowinc
0
270
スピンアウト講座02_ファイル管理
overflowinc
0
260
ABEMAのバグバウンティの取り組み
kurochan
1
150
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
2
13k
It’s “Time” to use Temporal
sajikix
3
240
モジュラモノリス導入から4年間の総括:アーキテクチャと組織の相互作用について / Architecture and Organizational Interaction
nazonohito51
3
1.2k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
5
18k
Escape from Excel方眼紙 ~マークダウンで繋ぐ、人とAIの架け橋~ /nikkei-tech-talk44
nikkei_engineer_recruiting
0
130
The_Evolution_of_Bits_AI_SRE.pdf
nulabinc
PRO
0
260
VPCエンドポイント意外とお金かかるなぁ。せや、共有したろ!
tommy0124
1
720
CyberAgentの生成AI戦略 〜変わるものと変わらないもの〜
katayan
0
280
AWSの資格って役に立つの?
tk3fftk
2
370
Featured
See All Featured
Everyday Curiosity
cassininazir
0
170
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Producing Creativity
orderedlist
PRO
348
40k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
130
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
980
Tell your own story through comics
letsgokoyo
1
850
It's Worth the Effort
3n
188
29k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
200
Paper Plane
katiecoart
PRO
0
48k
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できる