SlideShare une entreprise Scribd logo
1  sur  38
BDD x cucumber Sam Huang 2015/03/26
Allen Huang @ CCAgile
1
黃相文 Sam Huang
2nd year of Master in NTUT
2
前言
黃柏棋 Allen Huang
2nd year of Master in NTUT
3
TDD
BDD
BDD vs TDD
4
What is BDD ?
Behavior-driven Development
行為驅動開發
ビヘイビア駆動開発
행위 주도 개발
การพัฒนาพฤติกรรมการขับเคลื่อน
5
Behavior-driven Development
? User’s behavior
6
是一種敏捷開發的技術,它鼓勵軟體中的開發者, QA 與非技術人員或商業參
與者之間的協作。From Wikipedia
http://projectcartoon.com/
7
Coding / UTAT
8
PO QA Developers
User Story
Traditional Software Development
Software
X
Coding / UT
9
PO QA Developers
User Story
BDD
Software
Feature Steps
AT
10
User Story Acceptance Test
Feature Steps
PO QA
http://blog.andolasoft.com/2014/06/rails-things-you-must-know-about-tdd-and-bdd.html
11
Cons
1. 非技術人員與技術人員間更容易溝通
2. 技術人員可以更專注在程式上
3. 規格就是程式碼
4. 降低文件同步的成本
5. 完整了開發流程
12
Feature Steps
透過關鍵字來描述功能,將
User Story 轉成可執行的程式
將 Feature 內的流程對應到
使用者操作的步驟
Ruby
gem install cucumber
13
https://cukes.info/blog/2015/03/24/single-source-of-truth
14
How to use cucumber?
15
Given ThenWhen
定義在這個流程中的
前提條件
定義在什麼情況下會
發生這個流程
定義在這個流程結束
後,你想得到什麼樣
的結果
16
Example
17
Feature:Login
In order to use system
As a user
I can type my user name and password on login page
Scenario:Login successfully
Given I am on the system login page
When type my user name and password
Then login system, and see main page
Feature File - Eng
功能:登入
為了使用系統
身為使用者
我可以在登入頁面輸入我的帳號及密碼來登入
場景:成功登入
假如 我在系統的登入頁面
當 我輸入我的帳號及密碼
那麼 我可以登入系統,且看到系統的主頁面
Feature File – 中文
Given(/^I am on the system login page$/) do
bar bar bar …
end
When(/^type my user name and password$/) do
bar bar bar …
end
Then(/^login system, and see main page$/) do
bar bar bar …
end
Step File
Numerical
Input Steps
Feature
21
Quotation
marks Input
Steps
Feature
22
Table Input
Steps
Feature
23
cucumber 小小實例
24
小小計算機
25
You can clone this app from Github.
https://github.com/imidya/WebCalculator
小小計算機演算法
26
Algorithm (×, ÷)
+ 4 × 3 - 9 ÷ 35
27
Algorithm (×, ÷)
4 × 3 - 9 ÷ 3
5
+
28
Algorithm (×, ÷)
× 3 - 9 ÷ 3
5
+
4
29
Algorithm (×, ÷)
- 9 ÷ 3
5
+
4
× 3
12
30
Algorithm (×, ÷)
9 ÷ 3
5
+
12
-
31
Algorithm (×, ÷)
9
5
+
12
-
3÷
32
Algorithm (×, ÷)
9
5
+
12
-
3÷
3
33
Algorithm (+, -)
35 + 12 -
34
Algorithm (+, -)
3
5
+ 12 -
17
35
Algorithm (+, -)
3
17
-
14
36
LIVE DEMO
37
Q & A
38

Contenu connexe

En vedette

那一夜我們說Pattern design patterns 20周年-published
那一夜我們說Pattern design patterns 20周年-published那一夜我們說Pattern design patterns 20周年-published
那一夜我們說Pattern design patterns 20周年-publishedteddysoft
 
搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題
搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題
搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題teddysoft
 
重構三兩事
重構三兩事重構三兩事
重構三兩事teddysoft
 
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩Wen-Tien Chang
 
模式入門第一堂課: 30分鐘寫出一個模式
模式入門第一堂課: 30分鐘寫出一個模式模式入門第一堂課: 30分鐘寫出一個模式
模式入門第一堂課: 30分鐘寫出一個模式teddysoft
 
Design Patterns這樣學就會了:入門班 Day1 教材
Design Patterns這樣學就會了:入門班 Day1 教材Design Patterns這樣學就會了:入門班 Day1 教材
Design Patterns這樣學就會了:入門班 Day1 教材teddysoft
 
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)Chen Cheng-Wei
 
C.C. Agile#30 – Coding Dojo – Prepared Kata
C.C. Agile#30 – Coding Dojo – Prepared KataC.C. Agile#30 – Coding Dojo – Prepared Kata
C.C. Agile#30 – Coding Dojo – Prepared KataCCAgile
 

En vedette (8)

那一夜我們說Pattern design patterns 20周年-published
那一夜我們說Pattern design patterns 20周年-published那一夜我們說Pattern design patterns 20周年-published
那一夜我們說Pattern design patterns 20周年-published
 
搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題
搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題
搞懂Java例外處理的難題:Checked與Unchecked Exceptions不再是問題
 
重構三兩事
重構三兩事重構三兩事
重構三兩事
 
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
 
模式入門第一堂課: 30分鐘寫出一個模式
模式入門第一堂課: 30分鐘寫出一個模式模式入門第一堂課: 30分鐘寫出一個模式
模式入門第一堂課: 30分鐘寫出一個模式
 
Design Patterns這樣學就會了:入門班 Day1 教材
Design Patterns這樣學就會了:入門班 Day1 教材Design Patterns這樣學就會了:入門班 Day1 教材
Design Patterns這樣學就會了:入門班 Day1 教材
 
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
 
C.C. Agile#30 – Coding Dojo – Prepared Kata
C.C. Agile#30 – Coding Dojo – Prepared KataC.C. Agile#30 – Coding Dojo – Prepared Kata
C.C. Agile#30 – Coding Dojo – Prepared Kata
 

Similaire à Behavior Driven Development on C.C.Agile

2020 MOPCON - How to be Agile
2020 MOPCON - How to be Agile2020 MOPCON - How to be Agile
2020 MOPCON - How to be AgileJuggernaut Liu
 
導讀持續交付 2.0 - 談當代軟體交付之虛實融合
導讀持續交付 2.0 - 談當代軟體交付之虛實融合導讀持續交付 2.0 - 談當代軟體交付之虛實融合
導讀持續交付 2.0 - 談當代軟體交付之虛實融合Rick Hwang
 
IoT Cloud Platforms- Players, Vendors and Vertical Segments -20160519
IoT Cloud Platforms- Players, Vendors and Vertical Segments -20160519IoT Cloud Platforms- Players, Vendors and Vertical Segments -20160519
IoT Cloud Platforms- Players, Vendors and Vertical Segments -20160519August Lin
 
Developer Series 6x6 Tour: The power of interactive ads
Developer Series 6x6 Tour: The power of interactive adsDeveloper Series 6x6 Tour: The power of interactive ads
Developer Series 6x6 Tour: The power of interactive adsironSource
 
Scrum gathering 2012 shanghai 产品管理及用户体验 分会场:敏捷的hard模式 产品经理视角(窦涵之)
Scrum gathering 2012 shanghai 产品管理及用户体验 分会场:敏捷的hard模式 产品经理视角(窦涵之)Scrum gathering 2012 shanghai 产品管理及用户体验 分会场:敏捷的hard模式 产品经理视角(窦涵之)
Scrum gathering 2012 shanghai 产品管理及用户体验 分会场:敏捷的hard模式 产品经理视角(窦涵之)LetAgileFly
 
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227Bluer Wang(王小红)
 
Living documentation and km
Living documentation and kmLiving documentation and km
Living documentation and km民偉 李
 
2012 Phind Corp. 公司簡介
2012 Phind Corp. 公司簡介2012 Phind Corp. 公司簡介
2012 Phind Corp. 公司簡介Chia-Yu Kuo
 
[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐
[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐
[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐Edward Kuo
 
微服務的基礎建設 - Service Discovery, Andrew Wu
微服務的基礎建設 - Service Discovery, Andrew Wu微服務的基礎建設 - Service Discovery, Andrew Wu
微服務的基礎建設 - Service Discovery, Andrew WuAndrew Wu
 
From Coders to Builders of the Intelligent World
From Coders to Builders of the Intelligent WorldFrom Coders to Builders of the Intelligent World
From Coders to Builders of the Intelligent WorldHuawei Technologies
 
冉有 支付宝钱包的研发挑战和最佳实践
冉有 支付宝钱包的研发挑战和最佳实践冉有 支付宝钱包的研发挑战和最佳实践
冉有 支付宝钱包的研发挑战和最佳实践Trinea Trinea
 
Picoway Company Profile 1.5
Picoway Company Profile 1.5Picoway Company Profile 1.5
Picoway Company Profile 1.5picoway
 
Picoway Company Profile V1.5
Picoway Company Profile V1.5Picoway Company Profile V1.5
Picoway Company Profile V1.5picoway
 
20130313 新產品研發管理講座
20130313 新產品研發管理講座20130313 新產品研發管理講座
20130313 新產品研發管理講座CPCRDI
 
過來人經驗 - 在企業中推行 DevOps 前該具備的認知與工具箱
過來人經驗 - 在企業中推行 DevOps 前該具備的認知與工具箱過來人經驗 - 在企業中推行 DevOps 前該具備的認知與工具箱
過來人經驗 - 在企業中推行 DevOps 前該具備的認知與工具箱TIM WANG
 
敏捷开发全景视图(流程、方法和最佳实践)
敏捷开发全景视图(流程、方法和最佳实践)敏捷开发全景视图(流程、方法和最佳实践)
敏捷开发全景视图(流程、方法和最佳实践)Weijun Zhong
 
Slides qian anchuan_agile requirement analysis
Slides qian anchuan_agile requirement analysisSlides qian anchuan_agile requirement analysis
Slides qian anchuan_agile requirement analysisOdd-e
 

Similaire à Behavior Driven Development on C.C.Agile (20)

2020 MOPCON - How to be Agile
2020 MOPCON - How to be Agile2020 MOPCON - How to be Agile
2020 MOPCON - How to be Agile
 
導讀持續交付 2.0 - 談當代軟體交付之虛實融合
導讀持續交付 2.0 - 談當代軟體交付之虛實融合導讀持續交付 2.0 - 談當代軟體交付之虛實融合
導讀持續交付 2.0 - 談當代軟體交付之虛實融合
 
IoT Cloud Platforms- Players, Vendors and Vertical Segments -20160519
IoT Cloud Platforms- Players, Vendors and Vertical Segments -20160519IoT Cloud Platforms- Players, Vendors and Vertical Segments -20160519
IoT Cloud Platforms- Players, Vendors and Vertical Segments -20160519
 
Developer Series 6x6 Tour: The power of interactive ads
Developer Series 6x6 Tour: The power of interactive adsDeveloper Series 6x6 Tour: The power of interactive ads
Developer Series 6x6 Tour: The power of interactive ads
 
Scrum gathering 2012 shanghai 产品管理及用户体验 分会场:敏捷的hard模式 产品经理视角(窦涵之)
Scrum gathering 2012 shanghai 产品管理及用户体验 分会场:敏捷的hard模式 产品经理视角(窦涵之)Scrum gathering 2012 shanghai 产品管理及用户体验 分会场:敏捷的hard模式 产品经理视角(窦涵之)
Scrum gathering 2012 shanghai 产品管理及用户体验 分会场:敏捷的hard模式 产品经理视角(窦涵之)
 
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
数据平台建设进展汇报以及对产品人员工作的认识 王小红20140227
 
Living documentation and km
Living documentation and kmLiving documentation and km
Living documentation and km
 
2012 Phind Corp. 公司簡介
2012 Phind Corp. 公司簡介2012 Phind Corp. 公司簡介
2012 Phind Corp. 公司簡介
 
[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐
[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐
[MonkeyFest 2018 ] App 開發與 DevOps 上的實踐
 
微服務的基礎建設 - Service Discovery, Andrew Wu
微服務的基礎建設 - Service Discovery, Andrew Wu微服務的基礎建設 - Service Discovery, Andrew Wu
微服務的基礎建設 - Service Discovery, Andrew Wu
 
From Coders to Builders of the Intelligent World
From Coders to Builders of the Intelligent WorldFrom Coders to Builders of the Intelligent World
From Coders to Builders of the Intelligent World
 
冉有 支付宝钱包的研发挑战和最佳实践
冉有 支付宝钱包的研发挑战和最佳实践冉有 支付宝钱包的研发挑战和最佳实践
冉有 支付宝钱包的研发挑战和最佳实践
 
Picoway Company Profile 1.5
Picoway Company Profile 1.5Picoway Company Profile 1.5
Picoway Company Profile 1.5
 
Picoway Company Profile V1.5
Picoway Company Profile V1.5Picoway Company Profile V1.5
Picoway Company Profile V1.5
 
work@baidu 2014
work@baidu 2014work@baidu 2014
work@baidu 2014
 
20130313 新產品研發管理講座
20130313 新產品研發管理講座20130313 新產品研發管理講座
20130313 新產品研發管理講座
 
Flutter實作概述 | GDSC NYCU
Flutter實作概述 | GDSC NYCUFlutter實作概述 | GDSC NYCU
Flutter實作概述 | GDSC NYCU
 
過來人經驗 - 在企業中推行 DevOps 前該具備的認知與工具箱
過來人經驗 - 在企業中推行 DevOps 前該具備的認知與工具箱過來人經驗 - 在企業中推行 DevOps 前該具備的認知與工具箱
過來人經驗 - 在企業中推行 DevOps 前該具備的認知與工具箱
 
敏捷开发全景视图(流程、方法和最佳实践)
敏捷开发全景视图(流程、方法和最佳实践)敏捷开发全景视图(流程、方法和最佳实践)
敏捷开发全景视图(流程、方法和最佳实践)
 
Slides qian anchuan_agile requirement analysis
Slides qian anchuan_agile requirement analysisSlides qian anchuan_agile requirement analysis
Slides qian anchuan_agile requirement analysis
 

Behavior Driven Development on C.C.Agile

Notes de l'éditeur

  1. Feature:可以敘述一些關於此 feature file 在做的事情 Scenario:可以描述在這個功能下你想做的事情的流程
  2. Feature:可以敘述一些關於此 feature file 在做的事情 Scenario:可以描述在這個功能下你想做的事情的流程