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
My_TDD.pdf
Search
Masafumi Okura
February 11, 2020
Programming
0
83
My_TDD.pdf
Masafumi Okura
February 11, 2020
Tweet
Share
More Decks by Masafumi Okura
See All by Masafumi Okura
Why did my proposals get rejected?
okuramasafumi
1
440
A suggestion for the future of RDoc
okuramasafumi
1
66
15 JSON serializers for Ruby
okuramasafumi
2
110
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
39
Creating gems 101
okuramasafumi
1
82
How NOT to make your DSL terrible
okuramasafumi
0
280
オブジェクトしこう
okuramasafumi
2
210
Debugging Alba
okuramasafumi
1
190
Learning Ruby
okuramasafumi
5
560
Other Decks in Programming
See All in Programming
Click-free releases & the making of a CLI app
oheyadam
2
110
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
610
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
Jakarta EE meets AI
ivargrimstad
0
540
EventSourcingの理想と現実
wenas
6
2.3k
CSC509 Lecture 09
javiergs
PRO
0
140
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
How to Ace a Technical Interview
jacobian
276
23k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
We Have a Design System, Now What?
morganepeng
50
7.2k
Embracing the Ebb and Flow
colly
84
4.5k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Pragmatic Product Professional
lauravandoore
31
6.3k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Transcript
My TDD Speaker: େխ࢙ Event: େߐށRubyձٞ08 Date: 2020-02-11
ϝλ • εϥΠυຕɿ44ຕ • ൃද࣌ؒɿ20 • σϞɿ༗Γ
okuramasafumi.inspect • ໊લɿେխ࢙ • ॴଐɿϑϦʔϥϯε • ίϛϡχςΟɿGrow.rbओ࠵ɺͦͷଞଟࢀՃ • Rubyྺɿ7 •
झຯɿϓϩάϥϛϯάɺొஃɺᘖᘣɺӳޠ
࣍ 1. My TDD (first part) 2. My gem 3.
My TDD (second part) 4. ࠂ
1. My TDD (first part)
झຯɿϓϩάϥϛϯά
ϓϩάϥϛϯάָ͍͠
Ͱɺଞʹ༠͕ଟ͍
ͦ͜Ͱ…
TDD ➡
TDD ➡ Todan Driven Development
झຯɿొஃ
ࣗͷ࡞ΔιϑτΣΞʹ͍ͭͯൃද͢Δ ͜ͱͰ։ൃʹϓϨογϟʔΛ͔͚Δ
ࠓͷॴͱͯޮՌ͕͋Δ
͜Ε͕ࢲͷTDD
༨ஊɿ ඈߦػ৽װઢͷத࠷ߴͷϓϩάϥϛϯ άڥ
༨ஊͷ༨ஊɿ ࠓطʹ৽װઢʹ1ճͱඈߦػʹ2ճͬ ͍ͯ·͢ɻ͍ͩͿḿΓ·ͨ͠ɻ
͞Βʹ༨ஊɿ ։ൃΛਐΊΔͨΊͷख๏ͱͯ͠ɺTODO͕ ࣌ݶരʹͳΔΑ͏ͳgemΛॻ͍͍ͯΔਓ ͕͍·ͨ͠Ͷʢૉఢʣ
༨ஊऴΘΓ
ࠓ͍͑ͨ͜ͱͦͷұ • ϓϩάϥϛϯάָ͍͠ • ొஃָ͍͠ • Έ߹ΘͤͨΒ࠷ڧͰʁ • ΈΜͳͲΜͲΜొஃͯ͠ͲΜͲΜίʔυॻ͜͏
ͰɺԿΛ࡞͍ͬͯΔΜͰ͔͢ʁ
2. My gem
JSONγϦΞϥΠβΛ࡞͍ͬͯ·͢ɻ
طଘͷJSONγϦΞϥΠβͷ͜ͱ • jbuilderɿ͍ɺDSL݁ߏ͍͠ • ActiveModelSerializersɿϝϯς͞ΕͯΔͷ͔Θ͔Βͳ͍ɺ ෦ߏෳࡶɺ͋·Γ͘ͳ͍ • fast_jsonapiɿ͍͚ͲJSON:APIܗ͔ࣜ͠αϙʔτ͠ͳ͍
γϯϓϧͰɺϝϯς͕؆୯Ͱɺ DSL͕֮͑ͯ͘͢ɺ͍ͦͦ͜͜ɺ JSONγϦΞϥΠβΛ࡞Γ͍ͨʂ
Alba https://github.com/okuramasafumi/alba
0.1.0૬ͷͷ͕Ͱ͖ͨؾ͕͍ͯ͠·͢
ͳͷͰɺϦϦʔε͠·͢
Albaͷػೳʢࠓ࣌ʣ • JSONͷϧʔτΩʔΛઃఆՄೳ • attributesϝιουͰJSONʹؚΊΔଐੑΛෳࢦఆՄೳ • attributeϝιουͰJSONʹؚΊΔଐੑΛϒϩοΫͰࢦఆՄೳ • JSONͷόοΫΤϯυʹOjΛࢦఆՄೳ
ࠓ͍͑ͨ͜ͱͦͷ್ • Alba͍ͬͯ͏gemΛ࡞͍ͬͯ·͢ • ػೳ·ͩશવΓͳ͍͚Ͳɺ͜Ε͔ΒΨγΨγՃ͍ͨ͠ • طଘͷͷʹෆຬ͕͋ΔͳΒ࡞Ε͍͍͡Όͳ͍ • Ճ͖͢ػೳʹ͍ͭͯͷҙݟɺ͓͍ͪͯ͠·͢
ۤ࿑ͨ͠ • ΫϥεϝιουͷDSLͰઃఆͨ͠ใΛΠϯελϯε͔Βࢀর ͢ΔΑ͏ʹ͢ΔΈ • ࣮ޮੑ͕͋Δఔ͋ΔςετΛॻ͘͜ͱ • શମతͳUIͱઃܭ
ςετͱUI
3. My TDD (second part)
طଘͷϥΠϒϥϦʹΛײ͡Δ ≠ ͲΜͳ;͏ʹվળ͢Ε͍͍͔Θ͔Δ
ςετΛॻ͖ͳ͕Β୳͍ͬͯ͘
TDD ➡ Test Driven Development
ࢲͷ࠾༻ͨ͠ํ๏ • ·ͣϢʔεέʔεͷςετΛॻ͘ʢ༷ࡦఆʣ • ͳΜ͔ҧײ͕͋ͬͨΒςετΛॻ͖͢ʢ༷มߋʣ • ςετʹೲಘ͕͍ͬͨΒ࣮͢Δ • ࣮͕ऴΘͬͨΒݸผͷΫϥεͷςετΛޙ͔ΒՃ͢Δʢ࣮ ·ͩॻ͍ͯͳ͍ʣ
ϘτϜΞοϓͰͳ͘τοϓμϯ
͜Ε͕ࢲͷTDD
ࠓ͍͑ͨ͜ͱͦͷࢀ • ༷ͱ͔ɺͲ͏͍͏ΠϯλʔϑΣʔε͕ཧ͔ͳΜͯͦ͏؆୯ ʹΘ͔Βͳ͍ • ϢʔεέʔεΛςετԽͯ͠ɺೲಘߦ͘·Ͱॻ͘ • Ϣχοτςετޙ͚Ͱ͍͍ͷͰ
4. ࠂ
None
https://kaigionrails.org
·ͱΊ • ϓϩάϥϛϯάͱొஃָ͍͠ɺΈ߹ΘͤΔͱͬͱָ͍͠ • Alba͍ͬͯ͏gemɺ࡞ͬͯ·͢ • τοϓμϯͰϢʔεέʔε͔ΒςετΛॻ͘ͱ͍͍͔ • Kaigi on
RailsɺΓ·͢