Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Behavior Driven Development on C.C.Agile

366 views

Published on

This slides is used on C.C.Agile 2014/03/26.
You can clone demo app from https://github.com/imidya/WebCalculator

Published in: Engineering
  • Be the first to comment

Behavior Driven Development on C.C.Agile

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

×