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.3k
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
560
ざっとわかるPython
hakobe
4
6.7k
はてなで一人前のエンジニアになる方法
hakobe
3
6.5k
契約による設計の紹介
hakobe
6
20k
アクターによる 並行処理アプケーション アーキテクチャ
hakobe
4
3.2k
Scala In Perl Company
hakobe
11
12k
なめらかにGHEに移行する方法
hakobe
19
7.6k
開発フロー@はてなブックマーク
hakobe
0
140
Git on WebApp with Perl
hakobe
1
3.7k
Other Decks in Programming
See All in Programming
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
140
Three ways to use AI on Android: The Good, the Bad and the Ugly
marxallski
0
110
Code Reviews
bkuhlmann
4
900
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
1k
Elm 0.19.0 Changes
bkuhlmann
0
510
Elm Form Validation
bkuhlmann
0
510
Git Lint
bkuhlmann
4
760
敵対的ポイフル
futabato
0
130
Snowflakeで眠ったデータを起こそう!
estie
0
140
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
820
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.2k
WebGLで始める コンピュータグラフィックス入門
heller77
0
180
Featured
See All Featured
Robots, Beer and Maslow
schacon
PRO
155
7.9k
How GitHub (no longer) Works
holman
305
140k
How to name files
jennybc
65
93k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Designing for humans not robots
tammielis
247
25k
Side Projects
sachag
451
41k
Fantastic passwords and where to find them - at NoRuKo
philnash
39
2.5k
A Philosophy of Restraint
colly
197
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
21
6.4k
Producing Creativity
orderedlist
PRO
338
39k
For a Future-Friendly Web
brad_frost
172
9k
Raft: Consensus for Rubyists
vanstee
133
6.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 )