$30 off During Our Annual Pro Sale. View Details »
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
860
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
160
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
500
Ruby の型に関する活動をやっている話 / Activities related to Ruby types
euglena1215
3
270
そろそろ理解する includes / Understanding includes
euglena1215
1
850
習うより慣れる Ruby AST / Ruby AST is better to get used to than to learn.
euglena1215
2
430
Railsでエンドポイントごとのテストカバレッジを測定する / Measuring Test Coverage per Endpoint in Rails
euglena1215
1
430
初めてrails/railsにバグレポートを出してみた
euglena1215
0
210
XXXSerializer#to_json を地道に置き換えている話
euglena1215
0
150
Other Decks in Programming
See All in Programming
5分ぐらいで分かる、トリミング機能の作り方
tsutsuitakumi
0
210
Thoughts and experiences on Rust and TypeScript
unvalley
2
220
Reckoner における Datadog Browser Test の活用事例 / Datadog Browser Test at Reckoner
nomadblacky
0
190
アニメーションを最深まで理解してパフォーマンスを向上させる
mine2424
0
110
社内活動の取り組み紹介 ~ スリーシェイクでこんな取り組みしてます ~
bells17
0
390
コンテンツの主権を守るため(?)、高機能画像CDNからAWS自前対応に乗り換えた話
lengthtail
1
120
eBPF Deep Dive: Architecture and Safety Mechanisms
takehaya
12
1.2k
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
110
似たもの同士のPerlとPHP
uzulla
1
110
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
120
Jakarta EE meets AI
ivargrimstad
0
910
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
930
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
24
Rails Girls Zürich Keynote
gr2m
94
13k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
43
9.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
410
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Gamification - CAS2011
davidbonilla
80
5.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
780
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
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Λ࡞ͬͨͱ͖ʹ దͳྔͷςετΛॻ͚͍ͯΔ͔ ڳʹखΛͯͯߟ͑Δ͜ͱ͕Ͱ͖Δ