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
TDDの練習 Coding Kata の実践
Search
hakobe (Yohei Fushii)
April 19, 2014
Programming
0
1.4k
TDDの練習 Coding Kata の実践
hakobe (Yohei Fushii)
April 19, 2014
Tweet
Share
More Decks by hakobe (Yohei Fushii)
See All by hakobe (Yohei Fushii)
はてなにおけるプログラミング言語の歴史とこれから
hakobe
0
670
ざっとわかるPython
hakobe
4
6.8k
はてなで一人前のエンジニアになる方法
hakobe
3
6.8k
契約による設計の紹介
hakobe
6
20k
アクターによる 並行処理アプケーション アーキテクチャ
hakobe
4
3.4k
Scala In Perl Company
hakobe
11
12k
なめらかにGHEに移行する方法
hakobe
19
7.8k
開発フロー@はてなブックマーク
hakobe
0
160
Git on WebApp with Perl
hakobe
1
3.8k
Other Decks in Programming
See All in Programming
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
2024年のWebフロントエンドのふりかえりと2025年
sakito
2
250
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
2
280
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
2
210
もう僕は OpenAPI を書きたくない
sgash708
5
1.6k
Ruby on cygwin 2025-02
fd0
0
140
定理証明プラットフォーム lapisla.net
abap34
1
1.8k
Pulsar2 を雰囲気で使ってみよう
anoken
0
240
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
840
楽しく向き合う例外対応
okutsu
0
110
DROBEの生成AI活用事例 with AWS
ippey
0
130
チームリードになって変わったこと
isaka1022
0
200
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Fireside Chat
paigeccino
34
3.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
Mobile First: as difficult as doing things right
swwweet
223
9.3k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
Designing for Performance
lara
604
68k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.3k
Transcript
Coding Kata TDD practice with
hakobe hatena: id:hakobe932 twitter: @hakobe github: @hakobe
TDD Test Driven Developement
–Robert C. Martin “ཁ͢ΔʹTDDϓϩͷબͳͷͩɻ ࣮֬ੑɾܽؕࠞೖͷԼɾ༐ؾɾ υΩϡϝϯτɾઃܭΛଅਐ͢Δنͩɻ”
ϓϩͳΒTDDΛ͏
TDDͷࡾݪଇ 1. ࣦഊ͢ΔςετΛॻ͘·Ͱ ϓϩμΫγϣϯίʔυΛॻ͔ͳ͍ 2. ࣦഊͤ͞ΔతҎ֎ͰςετΛॻ͔ͳ͍ 3. ࣦഊ͢Δςετ͕ޭ͢Δ·Ͱ ଞͷϓϩμΫγϣϯίʔυΛॻ͔ͳ͍
Red Green Refactoring TDDͷ αΠΫϧ
࣮ફͰ͖ͯΔ? •͡ΊʹςετΛॻ͘บͰ͖ͯΔ? •͏·͘αΠΫϧΛ·ΘͤͯΔ? •ςετॻ͘ͷ͍͠෦ॻ͚Δ? •Fake It / Obvious Implementation /
Triangulation ͏·͘Ͱ͖ͯΔ?
࿅श
Coding Kata
Coding Kata ۭखͷܕʹͳͧΒ͑ͨɺϓϩάϥϛϯάͷ࿅शํ๏ɻ ! جຊతͳ՝Λ܁Γฦ͠࿅श͢Δ͜ͱͰɺ TDDͷΑ͏ͳنɺΤσΟλͷૢ࡞ํ๏ɺ Α͋͘ΔͷղܾखॱͳͲΛମʹછΈࠐ·ͤΔɻ
ϘϦϯάήʔϜ ‣10ϑϨʔϜ x ࠷େ 2 ͯ͠ 10 ݸͷϐϯΛ͢ ‣ετϥΠΫ Ϙʔφε:
࣍ͷ 2 ͷͨ͠ϐϯ ‣εϖΞ Ϙʔφε: ࣍ͷ 1 ͷͨ͠ϐϯ ‣10ϑϨʔϜ εϖΞ͔ετϥΠΫ͕ग़ͨΒ࠷େ3Ͱ͖Δ
ཁٻ༷ •roll(pins: Int) ϓϨΠϠʔ͕ϘʔϧΛ͛ͨ࣌ʹݺΕΔɻ Ҿͨ͠ϐϯɻ •score(): Int ͜ͷήʔϜͷείΞΛฦ͢ Game +
roll(pins: Int) + score(): Int
࣮ԋ Scala/spec2/IntelliJ/sbt
·ͱΊ • TDDϓϩͷश׳ • Coding KataͰ࿅शͯ͠ʹ͚ͭΑ͏ ࣮ࡍ͏·͍ͬͯ͘Δ? - TDDͷϦζϜ͕ʹͭ͘ -
։ൃڥྑ͘ͳΔ - ϓϩάϥϛϯάݴޠͷػೳΛֶΔ
ࢀߟจݙ • ΞδϟΠϧιϑτΣΞ։ൃͷԞٛ (ISBN: 978-4797347784) • εεϖοΫͷε ʲୈ 1 ճʳ
RSpec ͷ֓ཁ ͱɺRSpec on Rails (Ϟσϧฤ) ( http://magazine.rubyist.net/?0021-Rspec ) • ͜ͷൃදͷαϯϓϧίʔυ ( https:// github.com/hakobe/coding-kata-bowling )