Submit Search
Upload
iOSテスト自動化勉強会 -やはり俺達の回帰テストは間違っている-
•
Download as PPTX, PDF
•
2 likes
•
3,896 views
Y
Yusuke Hosonuma
Follow
Engineering
Report
Share
Report
Share
1 of 36
Download now
Recommended
Power shell で DSL
Power shell で DSL
urasandesu
自動テスト入れてみたけど、誰からも反応が無かった話。
自動テスト入れてみたけど、誰からも反応が無かった話。
naoyuki miyata
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
Recommended
Power shell で DSL
Power shell で DSL
urasandesu
自動テスト入れてみたけど、誰からも反応が無かった話。
自動テスト入れてみたけど、誰からも反応が無かった話。
naoyuki miyata
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
More Related Content
Featured
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
ChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
Featured
(20)
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
ChatGPT webinar slides
ChatGPT webinar slides
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
iOSテスト自動化勉強会 -やはり俺達の回帰テストは間違っている-
1.
テスト自動化の勉強会 やはり俺達の回帰テストは間違っている Yusuke Hosonuma
2.
最初に 言っておくことがある
3.
やはり 俺達の回帰テスト は間違っている
4.
回帰(リグレッション)テスト ・回帰テスト?人海戦術だね(ドヤッ ・回帰テスト?そんな時間ないでしょ? ・回帰テスト?なにそれ美味しいの?
5.
もはや時代錯誤もいいところ
6.
朗報
7.
『テストの自動化』 という考え方があります
8.
・テストをプログラムで記述する ・ことにより何度でも自動でテストできる ・ことにより変更に強くなる ・ことにより変更に対して勇気を持てる テストの自動化とは?
9.
『作業面』として → 回帰テストのコストを減らせる 『心理面』として → 仕様変更やリファクタリング、 そして何よりリリースに勇気を持てる つまり・・・
10.
Question & Answer
11.
・回帰テストやってますか? ・それで十分だと本当に思っていますか? ・仕様変更に自信を持てていますか? ・リリースの度に不安を抱えていませんか? ・リファクタリングしてますか? ・いつまでこんなことを続ける気ですか? Question.
12.
今のあなたの答えは重要ではありません。 これから現状を少しでも変えたいかどうか、 その気持ちと勇気があるかが重要です。 Answer.
13.
・単体テスティングフレームワーク、通称「 xUnit」は、Java向けのJUnitが最初ですが、 現在は殆どの言語に用意されています。 ・OSSでも積極的に利用されています。例え ばHTTPServerであるApacheのテストコード は、本体コードの10倍ちかくなっています。 xUnit
14.
xUnitによるユニットテスト
15.
・Objective-C向けのxUnit ・Xcodeに標準搭載されている ・既存プロジェクトへの導入も簡単 XCTest(えっくすしーてすと)
16.
・メソッド単位で完結するテスト → 2つの引数を足し算するとか ・状態を変更するメソッドのテスト → リストオブジェクトから削除とか XCTestで出来ること
17.
・UI(画面)のテスト → 一般的にはUnitTestでUIのテストは自動化し ません。難しいし、その価値に見合うリターン が得られないことが多いからです。 ・マクロのテスト → プリプロセッサなどObjective-Cランタイム から外れるものはテスト出来ません。 XCTestで出来ないこと
18.
①テスト対象の関数を呼び出す NSInteger price =
[Money tax:100]; ②期待値と比較する XCTAssertEqual(108, price, @”100円の消 費税は108円であること); XCTestの基本
19.
XCTest on Xcode
20.
・Modelクラス → MVCにおいて一番変更が少ない。 ・Util/Helperクラス → 関数単位で処理が完結することが多く書き やすい。 テストコードを書くべき箇所
21.
・Red → テストの失敗 ・Green → テストの成功 ・リファクタリング →
Greenである限りリファクタリングは成功 Red / Green / Refactoring
22.
現実を直視する
23.
・テストを定期的に実行する → Greenな状態を保たなければ、テストを自 動化する意味がありません。 ・Greenであれば大丈夫という勘違いをしない → テストコード、あるいは仕様自体が間違っ ていたら全く意味がありません。 あなたが絶対に守るべきこと
24.
・自動化すると品質上がる → 一側面ではありますが、これを強く語る人 は夢を見すぎている傾向が強いです。 現実を見ましょう。手でテストしたほうが効率 的なケースも多々有ります。 よくある間違った認識①
25.
・だれでも書ける → 一定のスキルが必要です。 xUnitを使うスキル。そして何より単体テスト しやすいコードを書くスキルが必要になります 。 よくある間違った認識②
26.
・テスト対象のコードは完璧な設計 → 時にはテスト対象のコードをリファクタリ ングする必要もあります。 ぐちゃぐちゃな依存関係のクラスをテストする のは苦痛ですし、少し変更が入るたびにテスト が失敗するようになり意味がありません。 よくある間違った認識③
27.
・ユニットテストはコストが低い → 実装コストの2倍は必要と言われます。 2倍は一般論であり、それに見合うだけのメリ ットがあるケースも十分あります。ただ、その コストを受け入れることが出来るかはプロジェ クト次第です。 よくある間違った認識④
28.
・結合テストは不要 → ・・・ 目をさませ!!( 'д'⊂彡☆))Д´)
パーン よくある間違った認識⑤
29.
まとめ
30.
・何度でも自動で実行できるテスト ・それによって得られるデグレの防止 ・それによって得られる変更に対する勇気 ・安全なリファクタリング ユニットテストで得られるもの
31.
・UI(画面)まわりのテスト ・結合レベルでの品質保証 ユニットテストで得られないもの
32.
・ユニットテストのスキルを身につける ・テストコードを書く ・テストコードを定期的に実行する ・テストコードをメンテナンスする ユニットテストで払う必要のある対価
33.
最後に
34.
・ユニットテストの一部についてしか、この資 料では語っていません。 ・一般論はあくまで一般論であり、あなたのプ ロジェクトに当てはまるかは分かりません。 ・ユニットテストはソフトウェア開発技法の一 つであり、それ以上でも以下でもありません。 注意事項
35.
想像してごらん・・・ リリース前に全ての単体テストが成功すること を確認できる・・・ そんな世界(ソフトウェア開発)を。 Let’s UnitTest
36.
ご清聴ありがとう ございました!
Download now