Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
My_TDD.pdf
Search
Masafumi Okura
February 11, 2020
Programming
97
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
My_TDD.pdf
Masafumi Okura
February 11, 2020
More Decks by Masafumi Okura
See All by Masafumi Okura
Ruby for complete beginners
okuramasafumi
1
150
Conference as a communication hub for all of us
okuramasafumi
0
91
Metaprogramming isn't real, it can't hurt you
okuramasafumi
0
190
Developing static sites with Ruby
okuramasafumi
1
470
Why doesn't Ruby have Boolean class - final version
okuramasafumi
0
430
Reading Rails 1.0 Source Code
okuramasafumi
0
390
RDoc meets YARD
okuramasafumi
4
290
Why doesn't Ruby have Boolean class?
okuramasafumi
0
82
My KaigiEffect at RubyKaigi 2025, part 1
okuramasafumi
1
120
Other Decks in Programming
See All in Programming
一人だけ、Kiroが静止する日
hideg
0
110
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
480
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
120
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
110
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
220
AIエージェント時代のコードレビューを設計する
nogu66
6
2.7k
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
280
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
490
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
140
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
110
App Intentsのビルドプロセスを支える技術
kntkymt
0
380
XHTMLが残したもの
yosuke_furukawa
PRO
2
810
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
エンジニアに許された特別な時間の終わり
watany
109
250k
Rails Girls Zürich Keynote
gr2m
96
14k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Building AI with AI
inesmontani
PRO
1
1.2k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
670
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Building Adaptive Systems
keathley
44
3.2k
Writing Fast Ruby
sferik
630
63k
Become a Pro
speakerdeck
PRO
31
6.3k
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ɺΓ·͢