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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ノハナ ノ テスト ノ ハナシ
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
460
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.9k
CoordinatorLayoutのBehaviorを使い倒す
seto_hi
1
460
Jetpack Compose
seto_hi
2
880
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.8k
MDCのButtonのCorner Family
seto_hi
1
260
MDCのBottomAppBarのShadowの実現方法
seto_hi
0
1.1k
Other Decks in Technology
See All in Technology
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.9k
【Cyber-sec+】経営層を"動かす"ための考え方
hssh2_bin
0
160
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
4
650
2026 TECHFRESH 畢業分享會 - AI-Native 重塑軟體工程與虛擬講師
line_developers_tw
PRO
0
930
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
21
6.8k
非エンジニアがClaudeと挑んだ「1ヶ月間プロダクト30本ノック」
askokc
0
430
ルールやカスタム機能、どう活かす?ハンズオンで体感するIBM Bobの出力コントロール
muehara
1
150
FinOps × AIエージェントで実現する コストインシデントの自動調査
oasis1994liveforever
0
130
protovalidate-es を導入してみた
bengo4com
0
180
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
Claude Code の Sandbox 機能を Anthropic Sandbox Runtime(srt) で試そう!/lets-play-anthropic-sandbox-runtime
tomoki10
1
570
AGENTS.mdとSkillsで始めるAIエージェント活用
sonoda_mj
3
210
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
The Cult of Friendly URLs
andyhume
79
6.9k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
170
Claude Code のすすめ
schroneko
67
230k
Done Done
chrislema
186
16k
Crafting Experiences
bethany
1
180
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
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できる