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
170
Git on WebApp with Perl
hakobe
1
3.8k
Other Decks in Programming
See All in Programming
「個人開発マネタイズ大全」が教えてくれたこと
bani24884
1
190
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
670
PRレビューのお供にDanger
stoticdev
1
230
Honoとフロントエンドの 型安全性について
yodaka
7
1.4k
もう少しテストを書きたいんじゃ〜 #phpstudy
o0h
PRO
17
3.9k
CDKを使ったPagerDuty連携インフラのテンプレート化
shibuya_shogo
0
110
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
920
CI改善もDatadogとともに
taumu
0
200
はじめての Go * WASM *OCR
sgash708
1
100
技術を改善し続ける
gumioji
0
120
Formの複雑さに立ち向かう
bmthd
1
930
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
8
2.4k
Featured
See All Featured
A Tale of Four Properties
chriscoyier
158
23k
RailsConf 2023
tenderlove
29
1k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
990
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
The Invisible Side of Design
smashingmag
299
50k
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 )