Soumettre la recherche
Mettre en ligne
PhpSpec TDD 紅燈-綠燈-重構流程-PHP也有day#25_by_閃亮亮
•
10 j'aime
•
1,994 vues
亮亮 閃
Suivre
Bowling Kata, GitHub:https://github.com/dj1020/Phpspec_Bowling_Kata_TDD/commits/master
Lire moins
Lire la suite
Formation
Signaler
Partager
Signaler
Partager
1 sur 41
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
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
光照 刘
Recommandé
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
Contenu connexe
En vedette
從 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
En vedette
(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 切版?
Similaire à 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
Similaire à 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
Dernier
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
National Information Standards Organization (NISO)
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Chameera Dedduwage
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
Jayanti Pande
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
Disha Kariya
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Sapana Sha
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
Janet Corral
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
agholdier
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
RaunakKeshri1
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
Thiyagu K
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
nomboosow
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
TechSoup
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
dawncurless
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
misteraugie
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
pragatimahajan3
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
fonyou31
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
PsychoTech Services
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
Admir Softic
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
Dernier
(20)
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
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 ?
Télécharger maintenant