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
ソフトウェアテスト第2章
Search
nikawa2161
September 16, 2024
4.9k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ソフトウェアテスト第2章
nikawa2161
September 16, 2024
Transcript
25 slides
知識ゼロから学ぶ ソフトウェアテスト 第2章 created by: Ô @nikawa2161 | @nikawa2161 |
✉
[email protected]
This is t-wada
Table of contents ⏪ どんなテスト⼿法が有効か ⏪ プログラムの振る舞いをテストする 制御パステスト法 ⏪ ステートメントカバレッジ
⏪ ブランチカバレッジ
よろしくお願いします
どんなテスト⼿法が有効か
ホワイトボックス 論理構造が正しいかを解析するテスト →プログラムの中にある if ⽂やループの部分がきちんと動作してい るか ブラックボックス 外部から⾒た動作や機能に焦点を当てたテスト →フォームに正しい⼊⼒を⾏った際に、期待した結果が得られるか
ホワイトボックス 論理構造が正しいかを解析するテスト →プログラムの中にある if ⽂やループの部分がきちんと動作してい るか ブラックボックス 外部から⾒た動作や機能に焦点を当てたテスト →フォームに正しい⼊⼒を⾏った際に、期待した結果が得られるか
ホワイトボックステストは 何⼗年にもわたって研究され、ソフトウェアの品質が改善されると証明されている
どのテスト⼿法を適⽤すべきなのか
テストは最⼤公約数的な作業 限られた時間で ·プログラミングは、⼀部の機能を削除することで帳尻を合わせられる ·テストは、ある機能をテストせずに出荷することはできない テストを始める前にテスト⼿法は吟味する必要がある
プログラムの振る舞いを テストする
制御パステスト プログラムがどのような振る舞いをして、どのように制御、実⾏されるかをテスト テスト⼿法の中でも基礎的かつ必須のテスト 網羅率の値を取るために利⽤される
事例 ファイナルファンタジー 以下の条件が重なった時にバグになった 「トラビア渓⾕」をクリア 1. 1の後に「セントラ遺跡」での制限付きイベントに臨む 2. 戦闘中に制限時間に達し、 「やめる·ゲームオーバー」を選ばない 3.
フローチャートにすると複雑ではない 制御パステストの本質は、このようなフローチャートをカバーする ことにある
ステートメントカバレッジ 制御パステスト
ステートメントカバレッジ 命令⽂を少なくとも⼀回は実⾏するテスト ①②のステートメント(命令⽂)を対処する if (const1 == 0) { x =
x + 1; //① } if (const2 > 1) { x = x * 1; //② }
ňテスト結果 bのテストができている cのテストができている dのテストができている eのテストができている コード内でconst2 > 0と記述した場合に、バグを⾒つけられない
⾮常に弱いテスト 分岐条件などのカバーできない部分をどうするか
ブランチカバレッジ 制御パステスト
ブランチカバレッジテスト 分岐コードに対してそれぞれの判定条件が True,Flaseの結果を少なくとも⼀回ずつ持つようにする
const1 = 0 と const2 = 2 const1 = 1
と const2 = 1 ňテスト結果 bのテストができている cのテストができている dのテストができている eのテストができている
ブランチカバレッジは網羅という意味では、ステートメントカバレッジより強い テストケースが増えるのが難点 ただ、ステートメントカバレッジだけでテスト終了することは⾮常に危険 バグの多くは、分岐点や例外処理にある
次回
カバレッジ基準
⽬黒エクスタシー
More Decks by nikawa2161
See All by nikawa2161
Node.js Subpath imports
nikawa2161
0
50
Sagaパターン入門(続編)
nikawa2161
0
59
Sagaパターン入門
nikawa2161
0
85
沖縄観光とPostgreSQL排他制約の話
nikawa2161
0
44
20251209_プログラミング原則の学び
nikawa2161
0
47
自分のコードを数年ぶりに読んだら
nikawa2161
0
29
ユーザーインタビュー分析に参加して得られたことと気づき
nikawa2161
0
49
oEmbedとは?
nikawa2161
0
280
はじめまして、にかわです
nikawa2161
0
34
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
1k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
580
Accessibility Awareness
sabderemane
1
310
Large-scale JavaScript Application Architecture
addyosmani
516
110k
What the history of the web can teach us about the future of AI
inesmontani
PRO
3
830
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.5k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
910
Prompt Engineering for Job Search
mfonobong
0
610
How to Talk to Developers About Accessibility
jct
2
630
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
YesSQL, Process and Tooling at Scale
rocio
174
15k