Top Banner
BDD programming the happy way by Leon Du Friday, September 10, 2010
17

BDD and Cucumber at barcampGZ

Nov 01, 2014

Download

Documents

leondu

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: BDD and Cucumber at barcampGZ

BDD programming the happy way

by Leon Du

Friday, September 10, 2010

Page 2: BDD and Cucumber at barcampGZ

Who Am I

• Freelancer / Ruby on Rails developer @guangzhou

• github.com/leondu

• twitter.com/leondu

• flickr.com/leondu

[email protected]

Friday, September 10, 2010

Page 3: BDD and Cucumber at barcampGZ

Talk about

• BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale,

high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters. --- from wikipedia.org

• a set of toolsRspecCucumberWebratCapybaraemail-spec

BDD, aka, Behavior Driven Development

Friday, September 10, 2010

Page 4: BDD and Cucumber at barcampGZ

Methodology

• Change the way of development

• Focus on behavior not only internal structure

• Ease the difficulty of communication

Friday, September 10, 2010

Page 5: BDD and Cucumber at barcampGZ

BDD Cycle

Text

---from The RSpec BookFriday, September 10, 2010

Page 6: BDD and Cucumber at barcampGZ

---from The RSpec BookFriday, September 10, 2010

Page 7: BDD and Cucumber at barcampGZ

the Tools

• RSpecfor internal behaviors

• Cucumberfor system behaviors

• Webrat/Capybara/email-spec...for common task steps

Friday, September 10, 2010

Page 8: BDD and Cucumber at barcampGZ

Cucumber

Friday, September 10, 2010

Page 9: BDD and Cucumber at barcampGZ

CucumberCucumber

Features

Scenarios

Steps

http://cukes.info/Friday, September 10, 2010

Page 10: BDD and Cucumber at barcampGZ

Feature

• Plain text

• Focus on behavior

Friday, September 10, 2010

Page 11: BDD and Cucumber at barcampGZ

Scenario

• Write Scenario with Given/When/Then

Friday, September 10, 2010

Page 12: BDD and Cucumber at barcampGZ

StepStep definition

and is translated to below:

Friday, September 10, 2010

Page 13: BDD and Cucumber at barcampGZ

Advance topics

Preparing data with Examples

Friday, September 10, 2010

Page 14: BDD and Cucumber at barcampGZ

Advance topicsTesting email with email-spec

email steps

Friday, September 10, 2010

Page 15: BDD and Cucumber at barcampGZ

BDD in other world

• JavaInstinct, JDave, JBehave, BDoc...http://java-sources.org/open-source/bdd

• .NetStoryQhttp://storyq.codeplex.com/

http://www.codeproject.com/KB/testing/bddintro.aspx

Friday, September 10, 2010

Page 16: BDD and Cucumber at barcampGZ

Special Thanks To

Rain Chen [email protected]

Friday, September 10, 2010

Page 17: BDD and Cucumber at barcampGZ

Questions?

Friday, September 10, 2010