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
CSC509 Lecture 11
javiergs
PRO
0
180
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
subpath importsで始めるモック生活
10tera
0
310
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
140
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
CSC509 Lecture 09
javiergs
PRO
0
140
Amazon Qを使ってIaCを触ろう!
maruto
0
410
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
Contemporary Test Cases
maaretp
0
140
Better Code Design in PHP
afilina
PRO
0
130
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
The Language of Interfaces
destraynor
154
24k
Fireside Chat
paigeccino
34
3k
Building Your Own Lightsaber
phodgson
103
6.1k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
420
Automating Front-end Workflow
addyosmani
1366
200k
Designing for humans not robots
tammielis
250
25k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
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Λ࡞ͬͨͱ͖ʹ దͳྔͷςετΛॻ͚͍ͯΔ͔ ڳʹखΛͯͯߟ͑Δ͜ͱ͕Ͱ͖Δ