Cucumber Recipes
Sonik Chopra
PMI ACP, PMP
Agile Coach, Manager
Pitney Bowes Software
What is Cucumber?
• Serves as documentation, automated tests
and development-aid - all rolled into one
format.
• Written by the team, in a language
understood by all.
• Cucumber is a Behaviour Driven Development
tool.
Agenda
• Introduction to BDD
• BDD Vs TDD
• Cucumber Features
• Demo: The real power of Cucumber
• Integration with different languages and
platforms
Behaviour Driven Development
Implementing an application by describing its
behaviour by the perspective of its
stakeholders..
Dan North
But don’t we already do this??
What we really do….
As a professional, I want to search for a conference
in India so that I can upgrade my skillset.
? User Stories are High Level
? Where to start with TDD?
? What to Test and what not to
Test
? What to call the tests?
? How much to test in one go?
Restricted view on Behaviour
Difference in thinking
SITE
LOCATION
PLACE
AREA
LOCALITY
DEV QA BA CLIENT PO
Increased Ambiguity  LOST
BDD – Outside In Pull Based
VISION
GOAL
FEATURE
STORY
SCENARIO
CODE
Scenarios and Examples in Ubiquitous Language
HAVING CONVERSATION IS
MORE IMPORTANT
TALKING THROUGH
EXAMPLES HELP DISCOVER
CONSIDERS MULTIPLE
STAKEHOLDERS
BDD Vs TDD
• Development Methodology Vs Development
Technique
• Business Driven Vs Design Approach
• Customer Writing Tests Vs Developers writing
Tests
• Focus on Behavioural Aspect Vs Implementation
Aspect
Cucumber Example…
Story:
As a user
I want to login with my details
So that I can get access to the site
Scenario: User uses wrong password
Given a username 'jdoe'
And a password 'letmein'
When the user logs in with username and password
Then the login form should be shown again
GHERKIN
LANGUAGE
Gherkin Supports
40+ Languages.
Cucumber at a glance…
Written in plain
English Language using
Gherkin
Source Code in Ruby
Or Java Or Dot Net etc
DEMO of Cucumber Capabilities
Cucumber
for Dot Net
SpecFlow
Iron Ruby
Cuke4Nuke
Cucumber
for Java
Cuke4Duke
Webdriver
tools
Watir
Selenium
Mobile
Android –
Calabash
IOS – Frank
Win Phone
Competitive
products
FIT/FITNESS
Robot
Framework
Concordian
EasyB
JBehave
Integration with other platforms
• TestBot Or Hydra : Tools used to run
Cucumber tests in parallel. You can also use
Jenkins and create slave machines.
• Relish: A service to publish cucumber features
as documentation
• FactoryGirl GEM: Test Data Builder
• Easy to Integrate with CI environment.
Cucumber Add Ons
Summary
• Cucumber is a BDD tool.
• One stop shop for Requirements,
Development, Scenarios and Acceptance test.
• Written by the team, in a language
understood by all.
• Easy to integrate with different environments.
• Supported in multiple languages and
platforms.
Thank You
Sonik Chopra
PMI ACP, PMP
Agile Coach, Manager
Pitney Bowes Software
sonikchopra@gmail.com
http://in.linkedin.com/in/sonikchopra
Twitter: @sonikchopra
Photo Credits
• http://www.drinkingo.com/wp-
content/uploads/2011/12/cucumber.jpg
• http://t0.gstatic.com/images?q=tbn:ANd9GcT1FW_GP53v
1b38wzbmZ569jzA1aooBpxG-vGl6fkB0YLRBMRbp
• http://t1.gstatic.com/images?q=tbn:ANd9GcQAesiC-
VaTAnisaVnVkF2xjEIC-ONQhX6adAWOWcTAZQFuDVVSjg
• http://t2.gstatic.com/images?q=tbn:ANd9GcQrrJsV3DnQ-
mLK6_uW_jWtU0tAitACM-GOPPxSoyDronBoQgIvKg
• http://www.flickr.com/photos/heimatiater/3256903620/
• http://t2.gstatic.com/images?q=tbn:ANd9GcQrrJsV3DnQ-
mLK6_uW_jWtU0tAitACM-GOPPxSoyDronBoQgIvKg

SGIN2013-ScrumStartRek-CucumberRecipes-SonikChopra

  • 1.
    Cucumber Recipes Sonik Chopra PMIACP, PMP Agile Coach, Manager Pitney Bowes Software
  • 2.
    What is Cucumber? •Serves as documentation, automated tests and development-aid - all rolled into one format. • Written by the team, in a language understood by all. • Cucumber is a Behaviour Driven Development tool.
  • 3.
    Agenda • Introduction toBDD • BDD Vs TDD • Cucumber Features • Demo: The real power of Cucumber • Integration with different languages and platforms
  • 4.
    Behaviour Driven Development Implementingan application by describing its behaviour by the perspective of its stakeholders.. Dan North
  • 5.
    But don’t wealready do this??
  • 6.
    What we reallydo…. As a professional, I want to search for a conference in India so that I can upgrade my skillset. ? User Stories are High Level ? Where to start with TDD? ? What to Test and what not to Test ? What to call the tests? ? How much to test in one go?
  • 7.
  • 8.
  • 9.
  • 10.
    BDD – OutsideIn Pull Based VISION GOAL FEATURE STORY SCENARIO CODE
  • 11.
    Scenarios and Examplesin Ubiquitous Language HAVING CONVERSATION IS MORE IMPORTANT TALKING THROUGH EXAMPLES HELP DISCOVER CONSIDERS MULTIPLE STAKEHOLDERS
  • 12.
    BDD Vs TDD •Development Methodology Vs Development Technique • Business Driven Vs Design Approach • Customer Writing Tests Vs Developers writing Tests • Focus on Behavioural Aspect Vs Implementation Aspect
  • 13.
    Cucumber Example… Story: As auser I want to login with my details So that I can get access to the site Scenario: User uses wrong password Given a username 'jdoe' And a password 'letmein' When the user logs in with username and password Then the login form should be shown again GHERKIN LANGUAGE Gherkin Supports 40+ Languages.
  • 14.
    Cucumber at aglance… Written in plain English Language using Gherkin Source Code in Ruby Or Java Or Dot Net etc
  • 15.
    DEMO of CucumberCapabilities
  • 16.
    Cucumber for Dot Net SpecFlow IronRuby Cuke4Nuke Cucumber for Java Cuke4Duke Webdriver tools Watir Selenium Mobile Android – Calabash IOS – Frank Win Phone Competitive products FIT/FITNESS Robot Framework Concordian EasyB JBehave Integration with other platforms
  • 17.
    • TestBot OrHydra : Tools used to run Cucumber tests in parallel. You can also use Jenkins and create slave machines. • Relish: A service to publish cucumber features as documentation • FactoryGirl GEM: Test Data Builder • Easy to Integrate with CI environment. Cucumber Add Ons
  • 18.
    Summary • Cucumber isa BDD tool. • One stop shop for Requirements, Development, Scenarios and Acceptance test. • Written by the team, in a language understood by all. • Easy to integrate with different environments. • Supported in multiple languages and platforms.
  • 19.
    Thank You Sonik Chopra PMIACP, PMP Agile Coach, Manager Pitney Bowes Software sonikchopra@gmail.com http://in.linkedin.com/in/sonikchopra Twitter: @sonikchopra
  • 20.
    Photo Credits • http://www.drinkingo.com/wp- content/uploads/2011/12/cucumber.jpg •http://t0.gstatic.com/images?q=tbn:ANd9GcT1FW_GP53v 1b38wzbmZ569jzA1aooBpxG-vGl6fkB0YLRBMRbp • http://t1.gstatic.com/images?q=tbn:ANd9GcQAesiC- VaTAnisaVnVkF2xjEIC-ONQhX6adAWOWcTAZQFuDVVSjg • http://t2.gstatic.com/images?q=tbn:ANd9GcQrrJsV3DnQ- mLK6_uW_jWtU0tAitACM-GOPPxSoyDronBoQgIvKg • http://www.flickr.com/photos/heimatiater/3256903620/ • http://t2.gstatic.com/images?q=tbn:ANd9GcQrrJsV3DnQ- mLK6_uW_jWtU0tAitACM-GOPPxSoyDronBoQgIvKg