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
2k
1
Share
ノハナ ノ テスト ノ ハナシ
2017/5/10
Android Testing Bootcamp #6
HiroYUKI Seto
May 10, 2017
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
450
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.9k
CoordinatorLayoutのBehaviorを使い倒す
seto_hi
1
450
Jetpack Compose
seto_hi
2
870
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.8k
MDCのButtonのCorner Family
seto_hi
1
250
MDCのBottomAppBarのShadowの実現方法
seto_hi
0
1.1k
Other Decks in Technology
See All in Technology
(きっとたぶん)人材育成や教育のような何かの話
sejima
0
610
Angular Architecture Revisited Modernizing Angular Architectural Patterns
rainerhahnekamp
0
130
毎日の作業を Claude Code 経由にしたら、 ノウハウがコードになった
kossykinto
0
620
自動テストだけで リリース判断できるチームへ - 鍵はテストの量ではなくリリース判断基準の再設計にあった / Redesigning Release Criteria for Lightweight Releases
ewa
7
3.4k
M5Stack CoreS3とZephyr(RTOS)で Edge AIっぽいことしてみた
iotengineer22
0
430
色を視る
yuzneri
0
320
OWASP APTSを眺めてみた
su3158
0
120
「QA=テスト」「シフトレフト=スクラムイベントの参加者の一員」の呪縛を解く。アジャイルな開発を止めないために、10Xで挑んだ「右側のしわ寄せ」解消記 #scrumniigata
nihonbuson
PRO
3
860
AI駆動開発で生産性を追いかけたら、行き着いたのは品質とシフトレフトだった
littlehands
0
390
コードや知識を組み込む / Incorporate Code and Knowledge
ks91
PRO
0
210
【技術書典20】OpenFOAM(自宅で深める流体解析)流れと熱移動(2)
kamakiri1225
0
370
AI와 협업하는 조직으로의 여정
arawn
0
590
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
530
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
180
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
Visualization
eitanlees
150
17k
The Curious Case for Waylosing
cassininazir
0
340
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
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できる