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
NUnit完全に理解した.pdf
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
ぐんちゃ
September 04, 2019
Technology
66
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
NUnit完全に理解した.pdf
「NUnitとは何か、どう動かすのか、どのように記述するのか」について、完全に理解したと勘違いしながら昔作りました。
ぐんちゃ
September 04, 2019
More Decks by ぐんちゃ
See All by ぐんちゃ
BPP行脚_しんすく(け)さん
guncha
0
140
BPP行脚_第4回_よしたけさん
guncha
0
89
BPP行脚_第3回_なそさん
guncha
0
77
BPP行脚_第5回_みずのりさん
guncha
0
98
BPP行脚_第2回_リナさん
guncha
0
150
BPP行脚_第1回_Mayさん
guncha
0
250
JaSST nano vol.25 ぼくたちが考える最強の 「正常系、異常系、 ハッピーパス、ワンパス」
guncha
0
260
ぼくたちが考える最強の 「正常系、異常系、 ハッピーパス、ワンパス」分科会ワーク前
guncha
0
460
QAの世界Part1 オープニング
guncha
0
1.5k
Other Decks in Technology
See All in Technology
攻撃者視点で考えるDetection Engineering
cryptopeg
3
1.7k
あなたの AI ワークスペースに、 専門コーダーを連れてくる - Amazon Quick Desktop 最新情報
kawaji_scratch
1
130
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
260
SONiCの統計情報を取得したい
sonic
0
140
Socrates × Looker 〜セマンティックレイヤーで進化するデータ分析エージェント〜
hanon52_
3
2.3k
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
380
AIソロプレナー時代に2ヶ月で20人増員した事業創造会社の開発組織の話
miyatakoji
0
650
AI駆動開発を通して感じた、 AI時代のデザイナーの役割変化
whisaiyo
3
2.1k
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
4
660
エンジニアリング戦略の作り方 / Crafting Engineering Strategy
iwashi86
21
6.8k
自律型AIエージェントは何を破壊するのか
kojira
0
160
プロダクト開発から業務改善コンサルまで。事業全体へ「染み出す」ことで広がるエンジニアの可能性
ham0215
0
120
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
380
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
200
We Have a Design System, Now What?
morganepeng
55
8.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
200
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Mind Mapping
helmedeiros
PRO
1
250
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Transcript
NUnit完全に理解した @akariwtnk
Table of contents 1.What's NUnit(ひとことで)? 2.What's NUnit(もうちょい詳しく)? 3.Let's try(動かしてみよう)! 4.Let's
try(書いてみよう)! 5.Difference(C#、VB.NETの相違点) 6.参考にしたサイト @akariwtnk
Table of contents 1.What's NUnit(ひとことで)? 2.What's NUnit(もうちょい詳しく)? 3.Let's try(動かしてみよう)! 4.Let's
try(書いてみよう)! 5.Difference(C#、VB.NETの相違点) 6.参考にしたサイト @akariwtnk
1.What's NUnit(ひとことで)? NUnitとは、⼀⾔で⾔うと 「単体テストの⾃動実⾏を⽀援するためのツール。」 NUnitのNは.NETのN。 @akariwtnk
Table of contents 1.What's NUnit(ひとことで)? 2.What's NUnit(もうちょい詳しく)? 3.Let's try(動かしてみよう)! 4.Let's
try(書いてみよう)! 5.Difference(C#、VB.NETの相違点) 6.参考にしたサイト @akariwtnk
2.What's NUnit(もうちょい詳しく)? プログラマーが単体テスト⽤のテスト・プログラムを作成し、それを実⾏することを⽀援 してくれる。 ⼤まかな流れは以下の通り。 i. テストされる側のクラス(例:Calculate)とテストする側のクラス(例: CalculateTest)を⽤意。 ii. Calculateに、x+yを計算して返すメソッド(AddValues())を書く。
iii. CalculateTestに、CalculateのAddValues()のxとyにそれぞれ何を代⼊したらどのよ うな結果になるはずかを書く。 iv. テストを実⾏し、結果を確認する。 @akariwtnk
2.What's NUnit(もうちょい詳しく)? つまり、テストプログラムは、プログラマー⾃⾝が記述しなければならない。 「そんな⾯倒なことやりたくない」?「時間がないから無理」?「テストは⾃分の仕事で はない」? 「テスト書いてないとかお前それ@t_wadaの前でも同じ事⾔えんの?」というライ オンのコピペが有名。 @akariwtnk
ライオンのコピペ(少しカットして縮めた) echo <<<T_WADA ,、,,,、,,, _,,;' '" '' ;;,, テスト書いてないとかお前それ@t_wadaの前でも同じ事⾔えんの? (rヽ,;''""''゛゛;,ノr)
,; i ___ 、__iヽ゛;, ,;'''|ヽ・〉〈・ノ |゙ ';, ,;''"| ▼ |゙゛';, ,;'' ヽ _⼈_ / ,;' /シ、 ヽ ⌒⌒ / リ \ | "r,,`"'''゙´ ,,ミ| | リ、 ,リ | | i ゛r、ノ,,r" i _ | | `ー―― -----------┴ ⌒´ ) T_WADA; @akariwtnk
…やってみましょう。 @akariwtnk
Table of contents 1.What's NUnit(ひとことで)? 2.What's NUnit(もうちょい詳しく)? 3.Let's try(動かしてみよう)! 4.Let's
try(書いてみよう)! 5.Difference(C#、VB.NETの相違点) 6.参考にしたサイト @akariwtnk
3.Let's try(動かしてみよう)! VB.NETで作成したものを置く予定。 実⾏⼿順の参考になるサイト:Qiita「Visual Studio 2015でNUnit3を使ってテストをす る」 https://qiita.com/84zume/items/0591b285a0162bc2ba0e @akariwtnk
3.Let's try(動かしてみよう)! もし以下のエラーが出てしまったら、NuGetからNUnitとNUnit3TestAdapterを⼀旦アン インストールし、もう⼀度インストールし直す。 「使⽤できるテストはありません。テスト探索プログラムと実⾏プログラムが登録されて おり、プラットフォームとフレームワークのバージョン設定が適切であることを確認し て、もう⼀度お試しください。」 @akariwtnk
Table of contents 1.What's NUnit(ひとことで)? 2.What's NUnit(もうちょい詳しく)? 3.Let's try(動かしてみよう)! 4.Let's
try(書いてみよう)! 5.Difference(C#、VB.NETの相違点) 6.参考にしたサイト @akariwtnk
4.Let's try(書いてみよう)! NUnitをNuGetで⼊れてテストコード書いて実⾏するまでの⼀連の⼿順は以下の通り。 https://m-tmatma.github.io/NUnit/NUnit.html @akariwtnk
Table of contents 1.What's NUnit(ひとことで)? 2.What's NUnit(もうちょい詳しく)? 3.Let's try(動かしてみよう)! 4.Let's
try(書いてみよう)! 5.Difference(C#、VB.NETの相違点) 6.参考にしたサイト @akariwtnk
5.Difference(C#、VB.NETの相違点) TestFixture テストコードを記述したクラスの上には TestFixture を付ける決まりになっており、 VB.NETなら<>で、C#なら[ ]で囲んで記述する必要がある。 Test 各テストメソッドの上には Test
を付ける決まりになっており、 VB.NETなら<>で、C#なら[ ]で囲んで記述する必要がある。 @akariwtnk
Table of contents 1.What's NUnit(ひとことで)? 2.What's NUnit(もうちょい詳しく)? 3.Let's try(動かしてみよう)! 4.Let's
try(書いてみよう)! 5.Difference(C#、VB.NETの相違点) 6.参考にしたサイト @akariwtnk
6.参考にしたサイト 「Visual Studio 2015でNUnit3を使ってテストをする」 https://qiita.com/84zume/items/0591b285a0162bc2ba0e 「NUnit3 の使い⽅」 https://m-tmatma.github.io/NUnit/NUnit.html 「NUnitの全貌 〜
基本から、最新バージョンの新機能まで」 https://codezine.jp/article/detail/6518 「NUnit⼊⾨ Test Firstのススメ」 https://www.atmarkit.co.jp/fdotnet/tools/nunit/nunit_01.html @akariwtnk