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
510
どんなときにテストを書いた方がいいのか/When should you write a test?
Shintani Teppei
June 08, 2020
Tweet
Share
More Decks by Shintani Teppei
See All by Shintani Teppei
ISUCONで型をつける
euglena1215
1
100
3年でバックエンドエンジニアが5倍に増えても破綻しなかったアーキテクチャ そして、これから / Software architecture that scales even with a 5x increase in backend engineers in 3 years
euglena1215
11
5k
モジュラモノリス、その前に / Modular monolith, before that
euglena1215
8
1k
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
200
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
690
Ruby の型に関する活動をやっている話 / Activities related to Ruby types
euglena1215
3
350
そろそろ理解する includes / Understanding includes
euglena1215
1
910
習うより慣れる Ruby AST / Ruby AST is better to get used to than to learn.
euglena1215
2
560
Railsでエンドポイントごとのテストカバレッジを測定する / Measuring Test Coverage per Endpoint in Rails
euglena1215
1
510
Other Decks in Programming
See All in Programming
Rubyの!メソッドをちゃんと理解する
alstrocrack
1
110
The New Developer Workflow: How AI Transforms Ideas into Code
danielsogl
0
100
Empowering Developers with HTML-Aware ERB Tooling @ RubyKaigi 2025, Matsuyama, Ehime
marcoroth
2
950
Cline with Amazon Bedrockで爆速開発体験ハンズオン/ 株式会社ブリューアス登壇資料
mhan
0
110
サービスレベルを管理してアジャイルを加速しよう!! / slm-accelerate-agility
tomoyakitaura
1
200
Road to RubyKaigi: Making Tinny Chiptunes with Ruby
makicamel
4
540
20250429 - CNTUG Meetup #67 / DevOps Taiwan Meetup #69 - Deep Dive into Tetragon: Building Runtime Security and Observability with eBPF
tico88612
0
160
エンジニア向けCursor勉強会 @ SmartHR
yukisnow1823
3
12k
Instrumentsを使用した アプリのパフォーマンス向上方法
hinakko
0
230
読書シェア会 vol.4 『ダイナミックリチーミング 第2版』
kotaro666
0
110
Ruby's Line Breaks
yui_knk
4
2.8k
Cursorを活用したAIプログラミングについて 入門
rect
0
150
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
4 Signs Your Business is Dying
shpigford
183
22k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Building Applications with DynamoDB
mza
94
6.4k
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.3k
GraphQLの誤解/rethinking-graphql
sonatard
71
10k
Faster Mobile Websites
deanohume
306
31k
For a Future-Friendly Web
brad_frost
177
9.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Side Projects
sachag
453
42k
How to Ace a Technical Interview
jacobian
276
23k
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Λ࡞ͬͨͱ͖ʹ దͳྔͷςετΛॻ͚͍ͯΔ͔ ڳʹखΛͯͯߟ͑Δ͜ͱ͕Ͱ͖Δ