Suche senden
Hochladen
PhpSpec TDD 紅燈-綠燈-重構流程-PHP也有day#25_by_閃亮亮
•
10 gefällt mir
•
1,994 views
亮亮 閃
Folgen
Bowling Kata, GitHub:https://github.com/dj1020/Phpspec_Bowling_Kata_TDD/commits/master
Weniger lesen
Mehr lesen
Bildung
Diashow-Anzeige
Melden
Teilen
Diashow-Anzeige
Melden
Teilen
1 von 41
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
亮亮 閃
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]
Kuro Hsu
Laravel - 系統全攻略
Laravel - 系統全攻略
Vincent Chi
PHPUnit 入門介紹
PHPUnit 入門介紹
Jace Ju
Android x 網路爬蟲
Android x 網路爬蟲
Engine Bai
Opensource 是人生的好朋友 2016-07-21
Opensource 是人生的好朋友 2016-07-21
CQD
教學課程Pdf備份
教學課程Pdf備份
楷霖 顏
Grpc go-in-php
Grpc go-in-php
光照 刘
Empfohlen
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
PHP也有day #27 - From apprentice to artisan 解耦合處理程序及單元測試
亮亮 閃
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]
Kuro Hsu
Laravel - 系統全攻略
Laravel - 系統全攻略
Vincent Chi
PHPUnit 入門介紹
PHPUnit 入門介紹
Jace Ju
Android x 網路爬蟲
Android x 網路爬蟲
Engine Bai
Opensource 是人生的好朋友 2016-07-21
Opensource 是人生的好朋友 2016-07-21
CQD
教學課程Pdf備份
教學課程Pdf備份
楷霖 顏
Grpc go-in-php
Grpc go-in-php
光照 刘
從 Php unit 到 ci 持續整合
從 Php unit 到 ci 持續整合
Joel Zhong
PHP WEB 应用组织与结构
PHP WEB 应用组织与结构
HonestQiao
APP Development Learning Experience Share - AppCoda
APP Development Learning Experience Share - AppCoda
Ryan Chung
TrainingProgramAtMobileDevTW
TrainingProgramAtMobileDevTW
Ryan Chung
Flexbox版面配置
Flexbox版面配置
景智 張
寫出高性能的服務與應用 那些你沒想過的事
寫出高性能的服務與應用 那些你沒想過的事
Chieh (Jack) Yu
UI guide Example
UI guide Example
Howlin Yang
React踩雷大作戰
React踩雷大作戰
皮馬 頑
從 LASS 到空氣盒子 - 談網路公民科學的實踐與未來
從 LASS 到空氣盒子 - 談網路公民科學的實踐與未來
Ling-Jyh Chen
Stock analysis
Stock analysis
Hal Chan
PHP教材
PHP教材
TaiShunHuang
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
Chen Cheng-Wei
PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)
TaiShunHuang
Bootstrap, Angel or Venture: Determining the Right Financing Strategy for You...
Bootstrap, Angel or Venture: Determining the Right Financing Strategy for You...
Judy Loehr
響應式網頁實作坊
響應式網頁實作坊
Chih-cheng Wang
Vue js 大型專案架構
Vue js 大型專案架構
Hina Chen
前端爆肝之旅+React上山前的小專案心得分享
前端爆肝之旅+React上山前的小專案心得分享
Yao Nien Chung
Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊
Miles Chou
專業前端 都如何管理 CSS
專業前端 都如何管理 CSS
Chih-cheng Wang
如何運用Bootstrap 切版?
如何運用Bootstrap 切版?
shiang huang
Debugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDB
bmbouter
Hacking with ruby2ruby
Hacking with ruby2ruby
Marc Chung
Weitere ähnliche Inhalte
Andere mochten auch
從 Php unit 到 ci 持續整合
從 Php unit 到 ci 持續整合
Joel Zhong
PHP WEB 应用组织与结构
PHP WEB 应用组织与结构
HonestQiao
APP Development Learning Experience Share - AppCoda
APP Development Learning Experience Share - AppCoda
Ryan Chung
TrainingProgramAtMobileDevTW
TrainingProgramAtMobileDevTW
Ryan Chung
Flexbox版面配置
Flexbox版面配置
景智 張
寫出高性能的服務與應用 那些你沒想過的事
寫出高性能的服務與應用 那些你沒想過的事
Chieh (Jack) Yu
UI guide Example
UI guide Example
Howlin Yang
React踩雷大作戰
React踩雷大作戰
皮馬 頑
從 LASS 到空氣盒子 - 談網路公民科學的實踐與未來
從 LASS 到空氣盒子 - 談網路公民科學的實踐與未來
Ling-Jyh Chen
Stock analysis
Stock analysis
Hal Chan
PHP教材
PHP教材
TaiShunHuang
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
Chen Cheng-Wei
PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)
TaiShunHuang
Bootstrap, Angel or Venture: Determining the Right Financing Strategy for You...
Bootstrap, Angel or Venture: Determining the Right Financing Strategy for You...
Judy Loehr
響應式網頁實作坊
響應式網頁實作坊
Chih-cheng Wang
Vue js 大型專案架構
Vue js 大型專案架構
Hina Chen
前端爆肝之旅+React上山前的小專案心得分享
前端爆肝之旅+React上山前的小專案心得分享
Yao Nien Chung
Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊
Miles Chou
專業前端 都如何管理 CSS
專業前端 都如何管理 CSS
Chih-cheng Wang
如何運用Bootstrap 切版?
如何運用Bootstrap 切版?
shiang huang
Andere mochten auch
(20)
從 Php unit 到 ci 持續整合
從 Php unit 到 ci 持續整合
PHP WEB 应用组织与结构
PHP WEB 应用组织与结构
APP Development Learning Experience Share - AppCoda
APP Development Learning Experience Share - AppCoda
TrainingProgramAtMobileDevTW
TrainingProgramAtMobileDevTW
Flexbox版面配置
Flexbox版面配置
寫出高性能的服務與應用 那些你沒想過的事
寫出高性能的服務與應用 那些你沒想過的事
UI guide Example
UI guide Example
React踩雷大作戰
React踩雷大作戰
從 LASS 到空氣盒子 - 談網路公民科學的實踐與未來
從 LASS 到空氣盒子 - 談網路公民科學的實踐與未來
Stock analysis
Stock analysis
PHP教材
PHP教材
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
PHP Conf Taiwan 2016 自動化與持續整合實作工作坊
PHP記帳網頁教材(第一頁是空白的)
PHP記帳網頁教材(第一頁是空白的)
Bootstrap, Angel or Venture: Determining the Right Financing Strategy for You...
Bootstrap, Angel or Venture: Determining the Right Financing Strategy for You...
響應式網頁實作坊
響應式網頁實作坊
Vue js 大型專案架構
Vue js 大型專案架構
前端爆肝之旅+React上山前的小專案心得分享
前端爆肝之旅+React上山前的小專案心得分享
Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊
專業前端 都如何管理 CSS
專業前端 都如何管理 CSS
如何運用Bootstrap 切版?
如何運用Bootstrap 切版?
Ähnlich wie PhpSpec TDD 紅燈-綠燈-重構流程-PHP也有day#25_by_閃亮亮
Debugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDB
bmbouter
Hacking with ruby2ruby
Hacking with ruby2ruby
Marc Chung
useR!2010 matome
useR!2010 matome
ybenjo
PHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacy
Damien Seguy
Writing Apps with HotCocoa and MacRuby
Writing Apps with HotCocoa and MacRuby
Renzo Borgatti
Php 7 hhvm and co
Php 7 hhvm and co
Pierre Joye
Mongo NYC PHP Development
Mongo NYC PHP Development
Fitz Agard
20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver
Naoki Sekiguchi
SECON'2017, Цаль-Цалко Иван, Go на практике
SECON'2017, Цаль-Цалко Иван, Go на практике
SECON
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
Hiroshi SHIBATA
D Is For Driven
D Is For Driven
Shintaro Kakutani
The Possibilities and Pitfalls of Writing Your Own State Stores with Daan Gertis
The Possibilities and Pitfalls of Writing Your Own State Stores with Daan Gertis
HostedbyConfluent
Biicode OpenExpoDay
Biicode OpenExpoDay
fcofdezc
C#7, 7.1, 7.2, 7.3 e C# 8
C#7, 7.1, 7.2, 7.3 e C# 8
Giovanni Bassi
Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!
Ivan Chernoff
Becoming a Git Master
Becoming a Git Master
Nicola Paolucci
Debugger Principle Overview & GDB Tricks
Debugger Principle Overview & GDB Tricks
dutor
Php4android TDC 2011
Php4android TDC 2011
Kinn Julião
Making and Breaking Web Services with Ruby
Making and Breaking Web Services with Ruby
err
Agile android
Agile android
Godfrey Nolan
Ähnlich wie PhpSpec TDD 紅燈-綠燈-重構流程-PHP也有day#25_by_閃亮亮
(20)
Debugging Hung Python Processes With GDB
Debugging Hung Python Processes With GDB
Hacking with ruby2ruby
Hacking with ruby2ruby
useR!2010 matome
useR!2010 matome
PHP 7.1 : elegance of our legacy
PHP 7.1 : elegance of our legacy
Writing Apps with HotCocoa and MacRuby
Writing Apps with HotCocoa and MacRuby
Php 7 hhvm and co
Php 7 hhvm and co
Mongo NYC PHP Development
Mongo NYC PHP Development
20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver
SECON'2017, Цаль-Цалко Иван, Go на практике
SECON'2017, Цаль-Цалко Иван, Go на практике
How to Begin to Develop Ruby Core
How to Begin to Develop Ruby Core
D Is For Driven
D Is For Driven
The Possibilities and Pitfalls of Writing Your Own State Stores with Daan Gertis
The Possibilities and Pitfalls of Writing Your Own State Stores with Daan Gertis
Biicode OpenExpoDay
Biicode OpenExpoDay
C#7, 7.1, 7.2, 7.3 e C# 8
C#7, 7.1, 7.2, 7.3 e C# 8
Pipfile, pipenv, pip… what?!
Pipfile, pipenv, pip… what?!
Becoming a Git Master
Becoming a Git Master
Debugger Principle Overview & GDB Tricks
Debugger Principle Overview & GDB Tricks
Php4android TDC 2011
Php4android TDC 2011
Making and Breaking Web Services with Ruby
Making and Breaking Web Services with Ruby
Agile android
Agile android
Kürzlich hochgeladen
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
manuelaromero2013
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
National Information Standards Organization (NISO)
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Krashi Coaching
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
RaunakKeshri1
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
pboyjonauth
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
JemimahLaneBuaron
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Chameera Dedduwage
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
pboyjonauth
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
GeoBlogs
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
eniolaolutunde
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
Thiyagu K
mini mental status format.docx
mini mental status format.docx
PoojaSen20
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
Maestría en Comunicación Digital Interactiva - UNR
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
sanyamsingh5019
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
Celine George
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
chloefrazer622
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
iammrhaywood
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
GaneshChakor2
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Sapana Sha
Kürzlich hochgeladen
(20)
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
mini mental status format.docx
mini mental status format.docx
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
PhpSpec TDD 紅燈-綠燈-重構流程-PHP也有day#25_by_閃亮亮
1.
PHP Day #25 TDD @ dj1020(at)gmail.com
2.
• • KKBOX • Laradiner •
http://blog.dj1020.net • dj1020(at)gmail.com
3.
TDD ✦ ✦ ✦ (Spec) ✦ (RED)
-> (GREEN) -> (REFACTOR)
4.
5.
TDD ✦ ✦ API ✦ debug ✦ ✦
Procedural Programming OOP
6.
Kata ✦ ✦ Code ✦ ✦ TDD Kata
TDD
7.
Kata Kata http://www.codingdojo.org/cgi-bin/index.pl?KataCatalogue
8.
Kata ✦ ( ) ✦ ✦
( ) ✦ TDD ✦ Editor ✦
9.
Bowling Kata ✦ 10 10
10.
Bowling ✦ 10 Strike
10 ✦ 10 Spare 10 ✦ Strike Spare
11.
Bowling Kata ✦ ✦ BowlingGame
Class methods 1. score() 2. roll($pins)
12.
Let’s Do It
13.
TDD $ git init
BowlingKata $ cd BowlingKata $ composer init $ composer require phpspec/phpspec $ ./vendor/bin/phpspec desc Twk/BowlingGame $ ./vendor/bin/phpspec run
14.
First Test RED
15.
Autoload composer.json { "require": { "phpspec/phpspec": "^2.5" }, "autoload"
: { "psr-4" : { “Twk" : "src/Twk" } } } $ composer dump
16.
First Test GREEN
17.
Test Case 1 RED 20
18.
Test Case 1 REDGREEN 20
19.
Test Case 2 RED 1
20
20.
Test Case 2 REDGREEN 1
20
21.
Test Case 2 REDREFACTOR DRY
Extract Method
22.
Test Case 2 REDREFACTOR design
23.
Test Case 3 RED 2,
8 Spare 2 10 + 2(bonus) + 2 = 14
24.
Test Case 3 REDGREEN 2,
8 Spare 2 10 + 2(bonus) + 2 = 14
25.
Test Case 4 RED 2,
8 Spare 2, 5 10 + 2(bonus) + 7 = 19
26.
Oh Oh … (design
flaw)
27.
TDD ✦ ✦ ✦ ✦ Test Case
28.
Test Case 3 RED 2,
8 Spare 2 10 + 2(bonus) + 2 = 14
29.
Test Case 3 REDGREEN 2,
8 Spare 2 10 + 2(bonus) + 2 = 14
30.
Test Case 4 REDGREEN 2,
8 Spare 2, 5 10 + 2(bonus) + 7 = 19
31.
Test Case 4 REDGREEN Consolidate
Duplicate Conditional Fragments REFACTOR
32.
Test Case 4 REDGREEN Rename
Variables REFACTOR
33.
Test Case 4 REDGREEN Decompose
Conditional Extract Method REFACTOR
34.
Test Case 4 REDGREEN Extract
rollSpace() method REFACTOR
35.
Test Case 5 RED (Strike)
3, 4 10 + 3(bonus) + 4(bonus) + 7 = 24
36.
Test Case 5 RED (Strike)
3, 4 10 + 3(bonus) + 4(bonus) + 7 = 24 GREEN
37.
Test Case 5 RED Extract
isStrike() method Extract rollStrike() method Extract spareBonus() method … GREENREFACTOR
38.
Test Case 6 RED Perfect
Game! 12 300 GREEN
39.
Test Case 7 RED 9
Spare 5 … 267 GREEN
40.
Test Case 8
… Test Case ^o^
41.
Q&A ?
Jetzt herunterladen