Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
自動テストについて / Automated Testing
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
mnuma
April 06, 2023
Technology
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
自動テストについて / Automated Testing
mnuma
April 06, 2023
Transcript
27 slides
2023.04.05 Makuake 社内LT @mnuma 自動テストについて
@mnuma タモリ倶楽部が終了してしまって悲しいです。 自己紹介
信頼性の高い自動化テストの実施 開発者が主体となった承認テストの作成・管理、およ び承認テストの容易な複製・修正 「テスト自動化」は ハイパフォーマー達 のプラクティス インプレス出版「LeanとDevOpsの科学」 p.65
自動テストの「信頼性」
None
正しい 間違ってる 成功 OK 偽陰性 失敗 偽陽性 OK テスト結果 コード
テストにおける偽陽性と偽陰性
テストにおける偽陽性と偽陰性 偽陽性: コードが正しいがテスト結果が失敗してしまう。誤検知。 ・脆いテスト (brittle test, fragile test) ・信頼不能テスト (flaky
test) 偽陰性: プロダクトコードが誤っているにもかかわらずテストが成功してしまう。 ・空振り ・カバレッジ不足
https://testing.googleblog.com/2010/12/test-sizes.html テストサイズ における分類
「結合テスト」とは? 連携されるシステム動作全般? 「ユニットテスト」とは? ロンドン学派 vs デトロイト学派 「テストサイズ」 曖昧な概念なので計測可能な定義付けを行ったもの。 テスト範囲で語ると混乱が起きがち
Small Medium Large 単一プロセスで実行されるテスト。 上限: 60秒 単一マシン上で実行されるテスト。 上限: 300秒 制約なし。
上限: 900秒+ Enormous もっとやばいやつ
Small Medium Large 言語の実行環境だけで動かせるテスト コンテナを組み合わせて実行するテスト 本番同等の環境にデプロイして実施するテスト Enormous もっとやばいやつ
「忠実性」 どんどん本番 に近くなる Small Medium Large 単一プロセスで実行されるテスト。 上限: 60秒 単一マシン上で実行されるテスト。
上限: 300秒 制約なし。 上限: 900秒+ Enormous もっとやばいやつ 「スピード」 どんどん 遅くなる 「非決定的」 複雑化し 予測出来なくなる
「忠実性」 どんどん本番 に近くなる Small Medium Large 単一プロセスで実行されるテスト。 上限: 60秒 単一マシン上で実行されるテスト。
上限: 300秒 制約なし。 上限: 900秒+ Enormous もっとやばいやつ 「スピード」 どんどん 遅くなる 「非決定的」 複雑化し 予測出来なくなる より本番に近い状況でテスト可能になる反面、 準備が難しく、動作は遅く、非決定的になりがち。 テスト失敗時分析も難しくなる。
テストのコスパ ✗ ✗ ✗
理想的なテスト
テストピラミッド 70% 20% 10% https://testing.googleblog.com/2015/04/just-say-no-to-more-end-to-end-tests.html くらいの 比率が望 ましい
Manual base Manual base Large Medium Smalll
Manual base Large Medium Smalll 速度 決定性 70% 20% 10%
コスト 忠実性
Inverted pyramid ice cream cone ✗ Hourglass pyramid ✗ ◦
実際には色々な変遷を辿ると思う
Manual base Large Medium Smalll 速度 決定性 70% 20% 10%
コスト 忠実性 サイズダウン 戦略
テスト自動化の 原則
テスト自動化の8原則 5. 自動テストシステムの開発は継続的 におこなうものである 6. 自動化検討はプロジェクト初期から 7. 自動テストで新種のバグが見つかる ことは稀である 8.
「テスト結果の分析」という新たな タスクが生まれる 1. 手動テストはなくならない 2. 手動でおこなって効果のないテス トを自動化しても無駄である 3. 自動テストは書いたことしかテス トしない 4. テスト自動化の効用はコスト削減 だけではない テスト自動化研究会 https://sites.google.com/site/testautomationresearch/test_automation_principle
繰り返し使われるテストのコストを削減 開発アクティビティへの効用 動いたはずの機能が壊れることを発見出来る 手動で実施したほうがテストの品質が高い 記述されたことしかテスト出来ない 運用に時間がかかる 最初から自動化が考慮されてない場合大変 テスト結果分析という新たなタスクが生まれる メリット (Pros)
デメリット (Cons)
手動テストはなくならない ユーザビリティテストなど、そもそも自動化できないテストタイプが存在する。 システムに対してはじめて実行されるテストはテストケース自体の成熟度の観点 から、手動で実施したほうがテスト実行の品質が高いケースが多い。また、自動 化がうまく進行している機能テストの残り数%など、テストを自動化するコスト とベネフィットが釣り合わないケースもある。これらの事情によって、手動で実 施されるテストが無くなることはない。
まとめ 自動テストを行ってハイパフォーマーの仲間入りをしよう 偽陰性 / 偽陽性 でテストの信頼性を意識しよう テストサイズを意識してコスパのいいテストをしよう ピラミッド型を意識したテスト戦略を立てよう 高品質である手動テストを活かせるようにしよう
END
More Decks by mnuma
See All by mnuma
セキュリティチェックシートの話 / Security Check Sheet
mnuma
0
56
Datadogで始めるユーザー行動分析 / Getting Started with User Behavior Analysis Using Datadog
mnuma
0
120
Kubernetesの自動アップグレードについて / Upgrading GKE cluster
mnuma
0
240
AWS Auroraのスロークエリを Datadogで扱うまで / How to handle slow_queries_logs in AWS Aurora with Datadog
mnuma
0
1.1k
Googleに学ぶDesign Docs / Learn from Google on Design Docs
mnuma
0
200
Observabilityを実践する / Pragmatic observability
mnuma
2
250
Kubernetes Case Studies #1@Makuake KubeCon NA 2019 Recap
mnuma
0
190
カオスエンジニアリングについてヤホーで調べてきました / Enter the chaos engineering
mnuma
0
140
Chaos Engineering 現状把握 / History Of Chaos Engineering
mnuma
0
420
Other Decks in Technology
See All in Technology
Agent Routerで作るマルチテナント 推論基盤 #CNDW2026 / Building Multi-Tenant Inference Platform with Agent Router #CNDW2026
everpeace
5
600
そのイメージ、どのCIが作った? Artifact Attestationsで来歴を固定する / Which CI system created that image? Pinning provenance with Artifact Attestations
chmikata
0
240
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
200
農家は秘伝のタレを知らない - NOBODY KNOWS THE HIDDEN SOURCE - Kaggriculture 3rd Place Solution
masspeaks
3
680
Kubernetes, Agones, WebRTC, GPU で作る クラウドゲーミング基盤を本番運用に乗せるまで
vivion
0
270
HTTP通信に使おうとすると実はめんどくさいfile_get_contents
maguroalternative
0
260
コーディングできない僕にBobが舞い降りた
shumpei3
0
190
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
20261113_JAWS_Osaka
takuyay0ne
1
600
Well, that’s weird…
csswizardry
1
200
gradle-best-practices 使ってみた
mikanichinose
0
220
人の努力に頼らないセキュリティをエンジニアリングする在り方 / An approach to engineering security that does not rely on human effort
carta_engineering
0
240
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
ラッコキーワード サービス紹介資料
rakko
5
6M
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
Skip the Path - Find Your Career Trail
mkilby
1
300
WENDY [Excerpt]
tessaabrams
15
41k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.7k
Thoughts on Productivity
jonyablonski
76
5.5k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Color Theory Basics | Prateek | Gurzu
gurzu
1
530
The Language of Interfaces
destraynor
162
27k