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
どんなときにテストを書いた方がいいのか/When should you write a test?
Search
Shintani Teppei
June 08, 2020
Programming
1
500
どんなときにテストを書いた方がいいのか/When should you write a test?
Shintani Teppei
June 08, 2020
Tweet
Share
More Decks by Shintani Teppei
See All by Shintani Teppei
モジュラモノリス、その前に / Modular monolith, before that
euglena1215
8
820
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
160
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
450
Ruby の型に関する活動をやっている話 / Activities related to Ruby types
euglena1215
3
260
そろそろ理解する includes / Understanding includes
euglena1215
1
830
習うより慣れる Ruby AST / Ruby AST is better to get used to than to learn.
euglena1215
2
420
Railsでエンドポイントごとのテストカバレッジを測定する / Measuring Test Coverage per Endpoint in Rails
euglena1215
1
420
初めてrails/railsにバグレポートを出してみた
euglena1215
0
200
XXXSerializer#to_json を地道に置き換えている話
euglena1215
0
150
Other Decks in Programming
See All in Programming
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.2k
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
色々なIaCツールを実際に触って比較してみる
iriikeita
0
340
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
260
Outline View in SwiftUI
1024jp
1
340
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
6
1.6k
みんなでプロポーザルを書いてみた
yuriko1211
0
280
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Arm移行タイムアタック
qnighy
0
340
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.8k
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Why Our Code Smells
bkeepers
PRO
334
57k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Being A Developer After 40
akosma
87
590k
Designing the Hi-DPI Web
ddemaree
280
34k
Writing Fast Ruby
sferik
627
61k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Git: the NoSQL Database
bkeepers
PRO
427
64k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Transcript
©2020 Wantedly, Inc. ͲΜͳͱ͖ʹςετΛॻ͍ͨํ͕͍͍ͷ͔ Jun 3, 2020 - Teppei Shintani
@euglena1215 దͳྔͷςετΛॻͨ͘Ίʹ͕ࣗؾΛ͚͍ͭͯΔ͜ͱ ࣾһݚम 2020
©2020 Wantedly, Inc. 5FQQFJ4IJOUBOJ !FVHMFOB w "VUI4RVBE1SFNJVN4RVBE w ৽ଔ w
3VCZ͕͖ ࣗݾհ
©2020 Wantedly, Inc. దͳྔͷςετ
©2020 Wantedly, Inc. ࠓͷΰʔϧ 1VMM3FRVFTUΛ࡞ͬͨͱ͖ʹ దͳྔͷςετΛॻ͚͍ͯΔ͔ ڳʹखΛͯͯߟ͑Δ͜ͱ͕Ͱ͖Δ ͕ࣗߟ͍͑ͯΔ͜ͱΛݴޠԽͯ͠ΈͨͷͰհ͠·͢
©2020 Wantedly, Inc. ͢͜ͱ͞ͳ͍͜ͱ w ͢͜ͱ • ͲΜͳͱ͖ʹςετΛॻ͘ඞཁੑ͕ߴ͍ͷ͔ • ͲΜͳͱ͖ʹςετΛॻ͘ඞཁੑ͕͍ͷ͔
w ͞ͳ͍͜ͱ • ମܥతͳςετख๏ςετͷྨ → ͕ࣗ͋·ΓΒͳ͍ʢ@qnighy ͕ৄͦ͠͏(͠ΒΜ͚Ͳ)ʣ • TDDͳͲͷಛఆͷϓϩάϥϜ։ൃख๏ → ͕ࣗ͋·ΓΒͳ͍ʢ@stomk ͕ৄͦ͠͏(͠ΒΜ͚Ͳ)ʣ
©2020 Wantedly, Inc. ߦͰ·ͱΊΔͱ ςετίʔυͷඞཁੑ มߋසʷ։ൃਓʷॏཁ
©2020 Wantedly, Inc. ςετίʔυͷඞཁੑมߋසº։ൃਓºॏཁ 1. 1ʹ1มߋ͞ΕΔՕॴͳͷ͔ɺ1ʹ1มߋ͞ΕΔՕॴͳͷ͔ 2. มߋස͕͚Εखಈςετͷํ͕ίεύྑ͍Մೳੑ͋Δ 1. ࣗಈςετ
ϥϯχϯάίετ / Πχγϟϧίετ ߴ 2. खಈςετ ϥϯχϯάίετ ߴ / Πχγϟϧίετ w FY JOJUJBMJ[FS CBUDIpMF มߋස͕ߴ͚Εߴ͍΄Ͳ ςετίʔυͷඞཁੑߴ·Δ
©2020 Wantedly, Inc. ςετίʔυͷඞཁੑมߋසº։ൃਓºॏཁ 1. ͦͷϑΝΠϧΛมߋ͢ΔਓͰͳͯ͘ɺͦͷมߋӨڹΛड͚Δ։ൃऀͷਓ 1. app/models/user.rb Λมߋͨ͠Βbackend։ൃͯ͠Δ΄΅શһ͕ӨڹΛड͚ΔՄೳੑ͕ ߴ͍
2. view ΑΓ controller, controller ΑΓ model ͷํ͕ӨڹΛड͚Δ։ൃऀͷਓଟ͘ͳ Γ͕ͪ 3. ։ൃਓ͕1,2ਓͰ͋Ε͋ΔఔѨჴͷݺٵͰ͍͚ͨΓ͢Δ 1. ʮ͜͜Λมߋ͢Δͬͯ͜ͱ͋ͬͪಉ࣌ʹมߋ͠ͳ͍ͱ͜ͷέʔεͰյΕΔͷͰʁʯ 2. ։ൃਓ͕ଟ͘ͳͬͯ͘ΔͱѨჴͷݺٵ͔ͳΓࠔ 3. Χ݄ޙͷࣗผਓͰ͋Δ͜ͱʹҙ
©2020 Wantedly, Inc. ςετίʔυͷඞཁੑมߋසº։ൃਓºॏཁ 1. ͕ͦ͜յΕͨΒͲͷ͘Β͍ࠔΔ͔ 1. Α͋͘ΔࢦඪɿӨڹϢʔβʔɺച্ 1. ࢀߟɿฏͷதʹ1࣌ؒαʔϏε͕μϯ͢ΔͱXXXXສԁఔͷଛࣦ
͜͜ʹ issue URL ͕ೖΔ 2. ͜ΕΒΛ͋ΔఔΧόʔ͍ͯ͠Δͷ͕ SLI/SLO ର endpoint Ұཡ ͜͜ʹ issue URL ͕ೖΔ 1. ͜ͷ endpoint ͕յΕΔՄೳੑͷ͋Δมߋॏཁ͕ߴ͍ͱࢥͬͯࠩ͠ࢧ͑ͳͦ͞͏
©2020 Wantedly, Inc. ςετΛॻ͔ͳ͍͍ͯ͘έʔεʜʁ ྫ͑ϋοΧιϯ มߋසˠϋοΧιϯऴΘͬͨΒϙΠࣺͯͳͷͰ ΄΅
։ൃਓˠdਓ͘Β͍ʁѨჴͷݺٵͰ௨͡Δ ॏཁˠൃදͰόάΒͳ͚Ε0,ɺച্ͳ͍ͷ Ͱۚમμϝʔδ
©2020 Wantedly, Inc. ͏Δͤ͑ɺͪ͜ͱΒϦϦʔεલͳΜ͡Όʂ ࠷খݶͷਖ਼ৗܥͷΈςετॻ͘ Γςετέʔε͚ͩॻ͍ͯ AQFOEJOHlޙͤͨA 1.
࣮ऀҎ֎͕ςετॻ͘ͱ͖ͷSTEP 1. ͲΜͳςετέʔε͕ଘࡏ͢Δͷ͔Ѳ͢Δ ←͕͜͜লུͰ͖Δ͚ͩͰ͔ͳΓخ͍͠ 2. ςετΛॻ͘
©2020 Wantedly, Inc. ߦͰ·ͱΊΔͱ ςετίʔυͷඞཁੑ มߋසʷ։ൃਓʷॏཁ
©2020 Wantedly, Inc. ࠓͷΰʔϧ 1VMM3FRVFTUΛ࡞ͬͨͱ͖ʹ దͳྔͷςετΛॻ͚͍ͯΔ͔ ڳʹखΛͯͯߟ͑Δ͜ͱ͕Ͱ͖Δ