SlideShare a Scribd company logo
BDD
                             programming the happy way
                                     by Leon Du




Friday, September 10, 2010
Who Am I
                     • Freelancer / Ruby on Rails developer
                             @guangzhou
                     • github.com/leondu
                     • twitter.com/leondu
                     • flickr.com/leondu
                     • leondu@gmail.com
Friday, September 10, 2010
Talk about
        BDD, aka, Behavior Driven Development

                     •       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   tools
                             Rspec
                             Cucumber
                             Webrat
                             Capybara
                             email-spec




Friday, September 10, 2010
Methodology

                     • Change the way of development
                     • Focus on behavior not only internal
                             structure
                     • Ease the difficulty of communication


Friday, September 10, 2010
BDD Cycle


                                Text




                                       ---from The RSpec Book
Friday, September 10, 2010
---from The RSpec Book
Friday, September 10, 2010
the Tools

                     • RSpec
                             for internal behaviors
                     • Cucumber
                             for system behaviors
                     • Webrat/Capybara/email-spec...
                             for common task steps



Friday, September 10, 2010
Cucumber




Friday, September 10, 2010
Cucumber
                             Cucumber

                               Features
                                 Scenarios

                                        Steps




                                  http://cukes.info/
Friday, September 10, 2010
Feature
                     • Plain text
                     • Focus on behavior




Friday, September 10, 2010
Scenario
                     • Write Scenario with Given/When/Then




Friday, September 10, 2010
Step
  Step definition



 and is translated to below:




Friday, September 10, 2010
Advance topics
                Preparing data with Examples




Friday, September 10, 2010
Advance topics
                Testing email with email-spec




                email steps




Friday, September 10, 2010
BDD in other world
                     • Java
                             Instinct, JDave, JBehave, BDoc...
                             http://java-sources.org/open-source/bdd


                     • .Net
                             StoryQ
                             http://storyq.codeplex.com/
                             http://www.codeproject.com/KB/testing/bddintro.aspx




Friday, September 10, 2010
Special Thanks To
                             Rain Chen hirainchen@gmail.com




Friday, September 10, 2010
Questions?


Friday, September 10, 2010

More Related Content

Viewers also liked

Letter of recommendation - Tomasz Blaszczyk
Letter of recommendation - Tomasz BlaszczykLetter of recommendation - Tomasz Blaszczyk
Letter of recommendation - Tomasz Blaszczyk
Tomasz Błaszczyk
 
3.hid
3.hid3.hid
FibroLAN Introduction 2011
FibroLAN Introduction 2011FibroLAN Introduction 2011
FibroLAN Introduction 2011
Jorge Rzezak
 
Dutch grammar version 1.1 es
Dutch grammar version 1.1 esDutch grammar version 1.1 es
Dutch grammar version 1.1 es
Valentina Kawtig
 
Interstuhl Healthy Sitting.Pptpower Point Update.Pptxjulia 2010
Interstuhl Healthy Sitting.Pptpower Point Update.Pptxjulia 2010Interstuhl Healthy Sitting.Pptpower Point Update.Pptxjulia 2010
Interstuhl Healthy Sitting.Pptpower Point Update.Pptxjulia 2010
AnitaRyan
 
Mobile Sports Group Case Studies Package 7
Mobile Sports Group Case Studies   Package 7Mobile Sports Group Case Studies   Package 7
Mobile Sports Group Case Studies Package 7
Rick Furr
 
o10media - Centros de estética y belleza de Zaragoza en google
o10media - Centros de estética y belleza de Zaragoza en googleo10media - Centros de estética y belleza de Zaragoza en google
o10media - Centros de estética y belleza de Zaragoza en google
o10media
 
Amplexor Romania Presentation
Amplexor Romania PresentationAmplexor Romania Presentation
Amplexor Romania Presentation
Amplexor
 
Lineas electricas
Lineas electricasLineas electricas
Lineas electricas
Harold Hernandez
 
Amway
AmwayAmway
Amway
nieves2win
 
Visita de la Receita Federal de Brasil. Gestión de Notificaciones y NEO / Man...
Visita de la Receita Federal de Brasil. Gestión de Notificaciones y NEO / Man...Visita de la Receita Federal de Brasil. Gestión de Notificaciones y NEO / Man...
Visita de la Receita Federal de Brasil. Gestión de Notificaciones y NEO / Man...
EUROsociAL II
 
Empresa 2.0 y recursos humanos
Empresa 2.0 y recursos humanosEmpresa 2.0 y recursos humanos
Empresa 2.0 y recursos humanos
ASV Consulting + University of Deusto
 
Transferencia de calor
Transferencia de calorTransferencia de calor
Transferencia de calor
Robert Ramos
 
Pprincipales mineras
Pprincipales minerasPprincipales mineras
Pprincipales mineras
Termotem Peru Sac
 
Presentación Action Coach
Presentación  Action CoachPresentación  Action Coach
Presentación Action Coach
OCANDOL
 
GJP Hotels & Resorts - Revista Fevereiro 2014
GJP Hotels & Resorts - Revista Fevereiro 2014GJP Hotels & Resorts - Revista Fevereiro 2014
GJP Hotels & Resorts - Revista Fevereiro 2014
GJP Hotels & Resorts
 

Viewers also liked (16)

Letter of recommendation - Tomasz Blaszczyk
Letter of recommendation - Tomasz BlaszczykLetter of recommendation - Tomasz Blaszczyk
Letter of recommendation - Tomasz Blaszczyk
 
3.hid
3.hid3.hid
3.hid
 
FibroLAN Introduction 2011
FibroLAN Introduction 2011FibroLAN Introduction 2011
FibroLAN Introduction 2011
 
Dutch grammar version 1.1 es
Dutch grammar version 1.1 esDutch grammar version 1.1 es
Dutch grammar version 1.1 es
 
Interstuhl Healthy Sitting.Pptpower Point Update.Pptxjulia 2010
Interstuhl Healthy Sitting.Pptpower Point Update.Pptxjulia 2010Interstuhl Healthy Sitting.Pptpower Point Update.Pptxjulia 2010
Interstuhl Healthy Sitting.Pptpower Point Update.Pptxjulia 2010
 
Mobile Sports Group Case Studies Package 7
Mobile Sports Group Case Studies   Package 7Mobile Sports Group Case Studies   Package 7
Mobile Sports Group Case Studies Package 7
 
o10media - Centros de estética y belleza de Zaragoza en google
o10media - Centros de estética y belleza de Zaragoza en googleo10media - Centros de estética y belleza de Zaragoza en google
o10media - Centros de estética y belleza de Zaragoza en google
 
Amplexor Romania Presentation
Amplexor Romania PresentationAmplexor Romania Presentation
Amplexor Romania Presentation
 
Lineas electricas
Lineas electricasLineas electricas
Lineas electricas
 
Amway
AmwayAmway
Amway
 
Visita de la Receita Federal de Brasil. Gestión de Notificaciones y NEO / Man...
Visita de la Receita Federal de Brasil. Gestión de Notificaciones y NEO / Man...Visita de la Receita Federal de Brasil. Gestión de Notificaciones y NEO / Man...
Visita de la Receita Federal de Brasil. Gestión de Notificaciones y NEO / Man...
 
Empresa 2.0 y recursos humanos
Empresa 2.0 y recursos humanosEmpresa 2.0 y recursos humanos
Empresa 2.0 y recursos humanos
 
Transferencia de calor
Transferencia de calorTransferencia de calor
Transferencia de calor
 
Pprincipales mineras
Pprincipales minerasPprincipales mineras
Pprincipales mineras
 
Presentación Action Coach
Presentación  Action CoachPresentación  Action Coach
Presentación Action Coach
 
GJP Hotels & Resorts - Revista Fevereiro 2014
GJP Hotels & Resorts - Revista Fevereiro 2014GJP Hotels & Resorts - Revista Fevereiro 2014
GJP Hotels & Resorts - Revista Fevereiro 2014
 

Similar to BDD and Cucumber at barcampGZ

Solit 2013, Behaviour Driven Development, Ихелис Александр
Solit 2013, Behaviour Driven Development, Ихелис АлександрSolit 2013, Behaviour Driven Development, Ихелис Александр
Solit 2013, Behaviour Driven Development, Ихелис Александр
solit
 
Mirah & Dubious Talk Ruby|Web 2010
Mirah & Dubious Talk Ruby|Web 2010Mirah & Dubious Talk Ruby|Web 2010
Mirah & Dubious Talk Ruby|Web 2010
baroquebobcat
 
Web Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To ComplexWeb Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To Complex
Brian Hogan
 
When is a Website Not Enough? Now.
When is a Website Not Enough? Now.When is a Website Not Enough? Now.
When is a Website Not Enough? Now.
bethgsanders
 
Debugging your JavaScript
Debugging your JavaScriptDebugging your JavaScript
Debugging your JavaScript
Diogo Antunes
 
OvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programmingOvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programming
Tor Björn Minde
 
HTML5 impact on application programming
HTML5 impact on application programmingHTML5 impact on application programming
HTML5 impact on application programming
Ericsson Labs
 
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScriptSencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
David Kaneda
 
CSS Bloat!
CSS Bloat!CSS Bloat!
CSS Bloat!
Nicole Sullivan
 
Vagrant at LA Ruby
Vagrant at LA RubyVagrant at LA Ruby
Vagrant at LA Ruby
Mitchell Hashimoto
 
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and JavascriptDr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
RobotDeathSquad
 
Slideshare presentation
Slideshare presentationSlideshare presentation
Slideshare presentation
PaniPuri Soft Limited
 
She saysdigiprodcrsetools2 23_sep_2011
She saysdigiprodcrsetools2 23_sep_2011She saysdigiprodcrsetools2 23_sep_2011
She saysdigiprodcrsetools2 23_sep_2011
SheSays US
 
Eclipse community management - fossa2010
Eclipse community management - fossa2010Eclipse community management - fossa2010
Eclipse community management - fossa2010
fOSSa - Free Open Source Software Academia Conference
 
HTML5: Toolkits and Gaps
HTML5: Toolkits and GapsHTML5: Toolkits and Gaps
HTML5: Toolkits and Gaps
dylanks
 
Introduction to DZone
Introduction to DZoneIntroduction to DZone
Introduction to DZone
Brandon Hoe
 
Jeff mc cune sf 2010
Jeff mc cune sf 2010Jeff mc cune sf 2010
Jeff mc cune sf 2010
Puppet
 
Aegir one drupal to rule them all
Aegir one drupal to rule them allAegir one drupal to rule them all
Aegir one drupal to rule them all
Development Seed
 
A web sized education problem?
A web sized education problem?A web sized education problem?
A web sized education problem?
Chris Mills
 
SDEC10-Bdd-quality-driven
SDEC10-Bdd-quality-drivenSDEC10-Bdd-quality-driven
SDEC10-Bdd-quality-driven
Amir Barylko
 

Similar to BDD and Cucumber at barcampGZ (20)

Solit 2013, Behaviour Driven Development, Ихелис Александр
Solit 2013, Behaviour Driven Development, Ихелис АлександрSolit 2013, Behaviour Driven Development, Ихелис Александр
Solit 2013, Behaviour Driven Development, Ихелис Александр
 
Mirah & Dubious Talk Ruby|Web 2010
Mirah & Dubious Talk Ruby|Web 2010Mirah & Dubious Talk Ruby|Web 2010
Mirah & Dubious Talk Ruby|Web 2010
 
Web Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To ComplexWeb Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To Complex
 
When is a Website Not Enough? Now.
When is a Website Not Enough? Now.When is a Website Not Enough? Now.
When is a Website Not Enough? Now.
 
Debugging your JavaScript
Debugging your JavaScriptDebugging your JavaScript
Debugging your JavaScript
 
OvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programmingOvertheAir 2010 html5 impact on application programming
OvertheAir 2010 html5 impact on application programming
 
HTML5 impact on application programming
HTML5 impact on application programmingHTML5 impact on application programming
HTML5 impact on application programming
 
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScriptSencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
Sencha Touch beta — Amazing Mobile Web Apps with HTML5, CSS3 & JavaScript
 
CSS Bloat!
CSS Bloat!CSS Bloat!
CSS Bloat!
 
Vagrant at LA Ruby
Vagrant at LA RubyVagrant at LA Ruby
Vagrant at LA Ruby
 
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and JavascriptDr. Strangelove: or How I learned to love HTML, CSS, and Javascript
Dr. Strangelove: or How I learned to love HTML, CSS, and Javascript
 
Slideshare presentation
Slideshare presentationSlideshare presentation
Slideshare presentation
 
She saysdigiprodcrsetools2 23_sep_2011
She saysdigiprodcrsetools2 23_sep_2011She saysdigiprodcrsetools2 23_sep_2011
She saysdigiprodcrsetools2 23_sep_2011
 
Eclipse community management - fossa2010
Eclipse community management - fossa2010Eclipse community management - fossa2010
Eclipse community management - fossa2010
 
HTML5: Toolkits and Gaps
HTML5: Toolkits and GapsHTML5: Toolkits and Gaps
HTML5: Toolkits and Gaps
 
Introduction to DZone
Introduction to DZoneIntroduction to DZone
Introduction to DZone
 
Jeff mc cune sf 2010
Jeff mc cune sf 2010Jeff mc cune sf 2010
Jeff mc cune sf 2010
 
Aegir one drupal to rule them all
Aegir one drupal to rule them allAegir one drupal to rule them all
Aegir one drupal to rule them all
 
A web sized education problem?
A web sized education problem?A web sized education problem?
A web sized education problem?
 
SDEC10-Bdd-quality-driven
SDEC10-Bdd-quality-drivenSDEC10-Bdd-quality-driven
SDEC10-Bdd-quality-driven
 

BDD and Cucumber at barcampGZ

  • 1. BDD programming the happy way by Leon Du Friday, September 10, 2010
  • 2. Who Am I • Freelancer / Ruby on Rails developer @guangzhou • github.com/leondu • twitter.com/leondu • flickr.com/leondu • leondu@gmail.com Friday, September 10, 2010
  • 3. Talk about BDD, aka, Behavior Driven Development • 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 tools Rspec Cucumber Webrat Capybara email-spec Friday, September 10, 2010
  • 4. Methodology • Change the way of development • Focus on behavior not only internal structure • Ease the difficulty of communication Friday, September 10, 2010
  • 5. BDD Cycle Text ---from The RSpec Book Friday, September 10, 2010
  • 6. ---from The RSpec Book Friday, September 10, 2010
  • 7. the Tools • RSpec for internal behaviors • Cucumber for system behaviors • Webrat/Capybara/email-spec... for common task steps Friday, September 10, 2010
  • 9. Cucumber Cucumber Features Scenarios Steps http://cukes.info/ Friday, September 10, 2010
  • 10. Feature • Plain text • Focus on behavior Friday, September 10, 2010
  • 11. Scenario • Write Scenario with Given/When/Then Friday, September 10, 2010
  • 12. Step Step definition and is translated to below: Friday, September 10, 2010
  • 13. Advance topics Preparing data with Examples Friday, September 10, 2010
  • 14. Advance topics Testing email with email-spec email steps Friday, September 10, 2010
  • 15. BDD in other world • Java Instinct, JDave, JBehave, BDoc... http://java-sources.org/open-source/bdd • .Net StoryQ http://storyq.codeplex.com/ http://www.codeproject.com/KB/testing/bddintro.aspx Friday, September 10, 2010
  • 16. Special Thanks To Rain Chen hirainchen@gmail.com Friday, September 10, 2010