SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
BDD using Cucumber 
By Ashish Mishra
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
10 Sec Intro 
Ashish Mishra 
20+ years experience 
Masters in Computer Science 
Author of Selenium Book by McGrawHill 
I am an Agilist! 
@ash1shm
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Ashish Mishra 
QAAgility Technologies Pvt. Ltd. – Founder Director 
M.S. Computer Science, Stevens Institute of Technology, USA; PG Certificate in Business Management from City University of NY (CUNY); B.E. CSE, Marathwada University. 
Certified Trainer for Agile Testing, Certified Scrum Master, Expertise in Account management, application delivery and business analysis 
20+ years of IT Industry experience with: 
Larsen & Toubro Infotech Ltd, India 
JPMorgan, India 
Chase Manhattan Bank, USA 
IBM, USA 
Prudential Insurance, USA 
Seasoned techno-functional entrepreneur with a track record of exhibiting innovative thought leadership, being self-driven, exceeding expectations and applying high standards. He belongs to the group of respectable innovators in the area of processes consulting & automation testing. He is the executive member of the Indian Testing Board (ITB) and founder of the Agile Testing Alliance (ATA). 
Experience in software testing, development, corporate training and public domain training. Over the period he has worked on number of projects as Account Manager, Test Manager, Programmer and Tester. His core expertise lies in Manual Testing, Test Automation and Test Management. 
Capital Markets related technology projects in delivering e2e mid to large size projects in the area of application development, re- engineering, process consulting and QA. Worked with clients spread across the globe, USA, UK, Germany, China, Singapore, Australia and Japan. 
Published author of the book "A Practitioner's Guide To Test Automation Using Selenium" by Tata McGraw-Hill.
Confidential | Copyright © QAAgility Technologies Pvt Ltd
Confidential | Copyright © QAAgility Technologies Pvt Ltd
Confidential | Copyright © QAAgility Technologies Pvt Ltd
Confidential | Copyright © QAAgility Technologies Pvt Ltd
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Tools Never Solve Problems 
•Fool with a tool is still a fool 
•Use right tool for the right problem
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Goal 
•Introduce Cucumber tool for Behavioral Driven Development
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
What is BDD 
•Hint: It is not about Test Automation
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Software – What can go wrong? 
•Implementation Defects 
•Requirement Defects
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Facts 
•50-60% of issues identified by testers can be linked to Requirement Defects 
•100-200% expensive to fix than other defects because the code is already written
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Requirements – often misunderstood
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Scrum 
US 1 and 2 
US 3 
US 1 ,2 ,3
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
BDD 
Business 
•Domain driven design 
Technology 
•Test driven development
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
describe the 
behavior 
of your software 
in a very understandable 
way
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Cucumber is Ruby-based BDD framework
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
What about Java? 
Java: Cucumber-JVM 
•Released in April 2012 
•Pure Java 
•Supports: Java, JavaScript, JRuby, Scala, Python, Groovy, Jython and JRuby
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
1 Describe Behaviour 
2 Write step definition 
3 Run and fail 
4 Write code to make step pass 
5 Run and pass
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Writing Scenario's in Cucumber 
•Scenarios are organized together into features 
•Each feature is represented as a plain text file. 
•Feature files must have the “.feature” extension 
•Each feature can contain many scenarios
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Behavior 
Feature: <short description> 
<story> 
<scenario 1> 
<scenario n> 
WHO? As a <role> WHAT? I want <feature> WHY? so that <business value> 
Scenario: <description> 
Given <preconditions, context> 
[And] <additional preconditions> 
When <action, behaviour> 
Then <postconditions> 
[And] <additional postconditions>
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
BDD Feature 
Feature: Depositing money in to a User account 
Scenario: Depositing money in to User's account should add money to the User's current balance 
Given a User has valid bank account 
And a User has $X money in their account 
When $Y is deposited in to the account 
Then the balance should be $(X+Y) 
This is Gherkin
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Gherkin 
Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behavior without detailing how that behavior is implemented. 
•Easy to read 
•Easy to understand 
•Easy to discuss 
•Easy to parse
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
How does BDD help? 
•All stakeholders involve in discussion 
•Specifications having acceptance tests built into them 
•As the software evolve the tests also updated 
•Specifications are about how the system should behave in various scenarios
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
User Story and Scenario 
Title (one line describing the story) 
Narrative: 
As a [role] 
I want [feature] 
So that [benefit] 
Acceptance Criteria: (presented as Scenarios) 
Scenario 1: Title 
Given [context] 
And [some more context]... 
When [event] 
Then [outcome] 
And [another outcome]...
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Scenarios 
Story: Account Holder withdraws cash 
As an Account Holder 
I want to withdraw cash from an ATM 
So that I can get money when the bank is closed 
Scenario 1: Account has sufficient funds 
Given the account balance is $100 
And the card is valid 
And the machine contains enough money 
When the Account Holder requests $20 
Then the ATM should dispense $20 
And the account balance should be $80 
And the card should be returned 
Scenario 2: Account has insufficient funds 
Given the account balance is $10 
And the card is valid 
And the machine contains enough money 
When the Account Holder requests $20 
Then the ATM should not dispense any money 
And the ATM should say there are insufficient funds 
And the account balance should be $20 
And the card should be returned 
Scenario 3: Card has been disabled 
Given the card is disabled 
When the Account Holder requests $20 
Then the ATM should retain the card 
And the ATM should say the card has been retained 
Scenario 4: The ATM has insufficient funds 
...
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Group Exercise 
•Read the ATA SSC Vision document and the user stories and write the Features in Given- When-Then format
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Attributes of Good Feature document 
•Complete 
•Testable 
•Specific
Confidential | Copyright © QAAgility Technologies Pvt Ltd 
Thank You. 
ashish.mishra@qaagility.com 
in.linkedin.com/in/ash1shm/ 
www.agiletestingalliance.org 
www.qaagility.com

Más contenido relacionado

Similar a Bdd using Cucumber

Hariprasad NEttem
Hariprasad NEttemHariprasad NEttem
Hariprasad NEttem
hari nettem
 
Sanju_July2015_Atlanta_QA_Test_Lead_0715
Sanju_July2015_Atlanta_QA_Test_Lead_0715Sanju_July2015_Atlanta_QA_Test_Lead_0715
Sanju_July2015_Atlanta_QA_Test_Lead_0715
sanju alex
 
Software Engineer IV - QA
Software Engineer IV - QASoftware Engineer IV - QA
Software Engineer IV - QA
Sharath Chandra
 

Similar a Bdd using Cucumber (20)

Agile Test Management Using Jira and Zephyr
Agile Test Management Using Jira and ZephyrAgile Test Management Using Jira and Zephyr
Agile Test Management Using Jira and Zephyr
 
Expo qa from user stories to automated acceptance tests with bdd
Expo qa   from user stories to automated acceptance tests with bddExpo qa   from user stories to automated acceptance tests with bdd
Expo qa from user stories to automated acceptance tests with bdd
 
Hariprasad NEttem
Hariprasad NEttemHariprasad NEttem
Hariprasad NEttem
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and MochaBdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
 
Agile Mumbai 2019 Conference | Intelligent DevOps enabling Enterprise Agilit...
Agile Mumbai 2019 Conference |  Intelligent DevOps enabling Enterprise Agilit...Agile Mumbai 2019 Conference |  Intelligent DevOps enabling Enterprise Agilit...
Agile Mumbai 2019 Conference | Intelligent DevOps enabling Enterprise Agilit...
 
Resume
ResumeResume
Resume
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test Automation
 
Sanju_July2015_Atlanta_QA_Test_Lead_0715
Sanju_July2015_Atlanta_QA_Test_Lead_0715Sanju_July2015_Atlanta_QA_Test_Lead_0715
Sanju_July2015_Atlanta_QA_Test_Lead_0715
 
Test Policy and Practices
Test Policy and PracticesTest Policy and Practices
Test Policy and Practices
 
Behaviour Driven Development: Oltre i limiti del possibile
Behaviour Driven Development: Oltre i limiti del possibileBehaviour Driven Development: Oltre i limiti del possibile
Behaviour Driven Development: Oltre i limiti del possibile
 
Specification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber ImplementationSpecification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber Implementation
 
Business Analyst in the Agile Space
Business Analyst in the Agile SpaceBusiness Analyst in the Agile Space
Business Analyst in the Agile Space
 
NavinB
NavinBNavinB
NavinB
 
SACHIN THAKARE
SACHIN THAKARESACHIN THAKARE
SACHIN THAKARE
 
Software Engineer IV - QA
Software Engineer IV - QASoftware Engineer IV - QA
Software Engineer IV - QA
 
Moving to DevOps the Amazon Way (DEV210-R1) - AWS re:Invent 2018
Moving to DevOps the Amazon Way (DEV210-R1) - AWS re:Invent 2018Moving to DevOps the Amazon Way (DEV210-R1) - AWS re:Invent 2018
Moving to DevOps the Amazon Way (DEV210-R1) - AWS re:Invent 2018
 
Agile Testing Alliance Chapter presentation - Agile estimation
Agile Testing Alliance Chapter presentation - Agile estimationAgile Testing Alliance Chapter presentation - Agile estimation
Agile Testing Alliance Chapter presentation - Agile estimation
 
Agile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven Design
 
my resume
my resumemy resume
my resume
 
Resume
ResumeResume
Resume
 

Más de Agile Testing Alliance

Más de Agile Testing Alliance (20)

#Interactive Session by Anindita Rath and Mahathee Dandibhotla, "From Good to...
#Interactive Session by Anindita Rath and Mahathee Dandibhotla, "From Good to...#Interactive Session by Anindita Rath and Mahathee Dandibhotla, "From Good to...
#Interactive Session by Anindita Rath and Mahathee Dandibhotla, "From Good to...
 
#Interactive Session by Ajay Balamurugadas, "Where Are The Real Testers In T...
#Interactive Session by  Ajay Balamurugadas, "Where Are The Real Testers In T...#Interactive Session by  Ajay Balamurugadas, "Where Are The Real Testers In T...
#Interactive Session by Ajay Balamurugadas, "Where Are The Real Testers In T...
 
#Interactive Session by Jishnu Nambiar and Mayur Ovhal, "Monitoring Web Per...
#Interactive Session by  Jishnu Nambiar and  Mayur Ovhal, "Monitoring Web Per...#Interactive Session by  Jishnu Nambiar and  Mayur Ovhal, "Monitoring Web Per...
#Interactive Session by Jishnu Nambiar and Mayur Ovhal, "Monitoring Web Per...
 
#Interactive Session by Pradipta Biswas and Sucheta Saurabh Chitale, "Navigat...
#Interactive Session by Pradipta Biswas and Sucheta Saurabh Chitale, "Navigat...#Interactive Session by Pradipta Biswas and Sucheta Saurabh Chitale, "Navigat...
#Interactive Session by Pradipta Biswas and Sucheta Saurabh Chitale, "Navigat...
 
#Interactive Session by Apoorva Ram, "The Art of Storytelling for Testers" at...
#Interactive Session by Apoorva Ram, "The Art of Storytelling for Testers" at...#Interactive Session by Apoorva Ram, "The Art of Storytelling for Testers" at...
#Interactive Session by Apoorva Ram, "The Art of Storytelling for Testers" at...
 
#Interactive Session by Nikhil Jain, "Catch All Mail With Graph" at #ATAGTR2023.
#Interactive Session by Nikhil Jain, "Catch All Mail With Graph" at #ATAGTR2023.#Interactive Session by Nikhil Jain, "Catch All Mail With Graph" at #ATAGTR2023.
#Interactive Session by Nikhil Jain, "Catch All Mail With Graph" at #ATAGTR2023.
 
#Interactive Session by Ashok Kumar S, "Test Data the key to robust test cove...
#Interactive Session by Ashok Kumar S, "Test Data the key to robust test cove...#Interactive Session by Ashok Kumar S, "Test Data the key to robust test cove...
#Interactive Session by Ashok Kumar S, "Test Data the key to robust test cove...
 
#Interactive Session by Seema Kohli, "Test Leadership in the Era of Artificia...
#Interactive Session by Seema Kohli, "Test Leadership in the Era of Artificia...#Interactive Session by Seema Kohli, "Test Leadership in the Era of Artificia...
#Interactive Session by Seema Kohli, "Test Leadership in the Era of Artificia...
 
#Interactive Session by Ashwini Lalit, RRR of Test Automation Maintenance" at...
#Interactive Session by Ashwini Lalit, RRR of Test Automation Maintenance" at...#Interactive Session by Ashwini Lalit, RRR of Test Automation Maintenance" at...
#Interactive Session by Ashwini Lalit, RRR of Test Automation Maintenance" at...
 
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
#Interactive Session by Srithanga Aishvarya T, "Machine Learning Model to aut...
 
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
#Interactive Session by Kirti Ranjan Satapathy and Nandini K, "Elements of Qu...
 
#Interactive Session by Sudhir Upadhyay and Ashish Kumar, "Strengthening Test...
#Interactive Session by Sudhir Upadhyay and Ashish Kumar, "Strengthening Test...#Interactive Session by Sudhir Upadhyay and Ashish Kumar, "Strengthening Test...
#Interactive Session by Sudhir Upadhyay and Ashish Kumar, "Strengthening Test...
 
#Interactive Session by Sayan Deb Kundu, "Testing Gen AI Applications" at #AT...
#Interactive Session by Sayan Deb Kundu, "Testing Gen AI Applications" at #AT...#Interactive Session by Sayan Deb Kundu, "Testing Gen AI Applications" at #AT...
#Interactive Session by Sayan Deb Kundu, "Testing Gen AI Applications" at #AT...
 
#Interactive Session by Dinesh Boravke, "Zero Defects – Myth or Reality" at #...
#Interactive Session by Dinesh Boravke, "Zero Defects – Myth or Reality" at #...#Interactive Session by Dinesh Boravke, "Zero Defects – Myth or Reality" at #...
#Interactive Session by Dinesh Boravke, "Zero Defects – Myth or Reality" at #...
 
#Interactive Session by Saby Saurabh Bhardwaj, "Redefine Quality Assurance –...
#Interactive Session by  Saby Saurabh Bhardwaj, "Redefine Quality Assurance –...#Interactive Session by  Saby Saurabh Bhardwaj, "Redefine Quality Assurance –...
#Interactive Session by Saby Saurabh Bhardwaj, "Redefine Quality Assurance –...
 
#Keynote Session by Sanjay Kumar, "Innovation Inspired Testing!!" at #ATAGTR2...
#Keynote Session by Sanjay Kumar, "Innovation Inspired Testing!!" at #ATAGTR2...#Keynote Session by Sanjay Kumar, "Innovation Inspired Testing!!" at #ATAGTR2...
#Keynote Session by Sanjay Kumar, "Innovation Inspired Testing!!" at #ATAGTR2...
 
#Keynote Session by Schalk Cronje, "Don’t Containerize me" at #ATAGTR2023.
#Keynote Session by Schalk Cronje, "Don’t Containerize me" at #ATAGTR2023.#Keynote Session by Schalk Cronje, "Don’t Containerize me" at #ATAGTR2023.
#Keynote Session by Schalk Cronje, "Don’t Containerize me" at #ATAGTR2023.
 
#Interactive Session by Chidambaram Vetrivel and Venkatesh Belde, "Revolution...
#Interactive Session by Chidambaram Vetrivel and Venkatesh Belde, "Revolution...#Interactive Session by Chidambaram Vetrivel and Venkatesh Belde, "Revolution...
#Interactive Session by Chidambaram Vetrivel and Venkatesh Belde, "Revolution...
 
#Interactive Session by Aniket Diwakar Kadukar and Padimiti Vaidik Eswar Dat...
#Interactive Session by Aniket Diwakar Kadukar and  Padimiti Vaidik Eswar Dat...#Interactive Session by Aniket Diwakar Kadukar and  Padimiti Vaidik Eswar Dat...
#Interactive Session by Aniket Diwakar Kadukar and Padimiti Vaidik Eswar Dat...
 
#Interactive Session by Vivek Patle and Jahnavi Umarji, "Empowering Functiona...
#Interactive Session by Vivek Patle and Jahnavi Umarji, "Empowering Functiona...#Interactive Session by Vivek Patle and Jahnavi Umarji, "Empowering Functiona...
#Interactive Session by Vivek Patle and Jahnavi Umarji, "Empowering Functiona...
 

Último

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Último (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 

Bdd using Cucumber

  • 1. BDD using Cucumber By Ashish Mishra
  • 2. Confidential | Copyright © QAAgility Technologies Pvt Ltd 10 Sec Intro Ashish Mishra 20+ years experience Masters in Computer Science Author of Selenium Book by McGrawHill I am an Agilist! @ash1shm
  • 3. Confidential | Copyright © QAAgility Technologies Pvt Ltd Ashish Mishra QAAgility Technologies Pvt. Ltd. – Founder Director M.S. Computer Science, Stevens Institute of Technology, USA; PG Certificate in Business Management from City University of NY (CUNY); B.E. CSE, Marathwada University. Certified Trainer for Agile Testing, Certified Scrum Master, Expertise in Account management, application delivery and business analysis 20+ years of IT Industry experience with: Larsen & Toubro Infotech Ltd, India JPMorgan, India Chase Manhattan Bank, USA IBM, USA Prudential Insurance, USA Seasoned techno-functional entrepreneur with a track record of exhibiting innovative thought leadership, being self-driven, exceeding expectations and applying high standards. He belongs to the group of respectable innovators in the area of processes consulting & automation testing. He is the executive member of the Indian Testing Board (ITB) and founder of the Agile Testing Alliance (ATA). Experience in software testing, development, corporate training and public domain training. Over the period he has worked on number of projects as Account Manager, Test Manager, Programmer and Tester. His core expertise lies in Manual Testing, Test Automation and Test Management. Capital Markets related technology projects in delivering e2e mid to large size projects in the area of application development, re- engineering, process consulting and QA. Worked with clients spread across the globe, USA, UK, Germany, China, Singapore, Australia and Japan. Published author of the book "A Practitioner's Guide To Test Automation Using Selenium" by Tata McGraw-Hill.
  • 4. Confidential | Copyright © QAAgility Technologies Pvt Ltd
  • 5. Confidential | Copyright © QAAgility Technologies Pvt Ltd
  • 6. Confidential | Copyright © QAAgility Technologies Pvt Ltd
  • 7. Confidential | Copyright © QAAgility Technologies Pvt Ltd
  • 8. Confidential | Copyright © QAAgility Technologies Pvt Ltd Tools Never Solve Problems •Fool with a tool is still a fool •Use right tool for the right problem
  • 9. Confidential | Copyright © QAAgility Technologies Pvt Ltd Goal •Introduce Cucumber tool for Behavioral Driven Development
  • 10. Confidential | Copyright © QAAgility Technologies Pvt Ltd What is BDD •Hint: It is not about Test Automation
  • 11. Confidential | Copyright © QAAgility Technologies Pvt Ltd Software – What can go wrong? •Implementation Defects •Requirement Defects
  • 12. Confidential | Copyright © QAAgility Technologies Pvt Ltd Facts •50-60% of issues identified by testers can be linked to Requirement Defects •100-200% expensive to fix than other defects because the code is already written
  • 13. Confidential | Copyright © QAAgility Technologies Pvt Ltd Requirements – often misunderstood
  • 14. Confidential | Copyright © QAAgility Technologies Pvt Ltd Scrum US 1 and 2 US 3 US 1 ,2 ,3
  • 15. Confidential | Copyright © QAAgility Technologies Pvt Ltd BDD Business •Domain driven design Technology •Test driven development
  • 16. Confidential | Copyright © QAAgility Technologies Pvt Ltd describe the behavior of your software in a very understandable way
  • 17. Confidential | Copyright © QAAgility Technologies Pvt Ltd Cucumber is Ruby-based BDD framework
  • 18. Confidential | Copyright © QAAgility Technologies Pvt Ltd What about Java? Java: Cucumber-JVM •Released in April 2012 •Pure Java •Supports: Java, JavaScript, JRuby, Scala, Python, Groovy, Jython and JRuby
  • 19. Confidential | Copyright © QAAgility Technologies Pvt Ltd 1 Describe Behaviour 2 Write step definition 3 Run and fail 4 Write code to make step pass 5 Run and pass
  • 20. Confidential | Copyright © QAAgility Technologies Pvt Ltd Writing Scenario's in Cucumber •Scenarios are organized together into features •Each feature is represented as a plain text file. •Feature files must have the “.feature” extension •Each feature can contain many scenarios
  • 21. Confidential | Copyright © QAAgility Technologies Pvt Ltd Behavior Feature: <short description> <story> <scenario 1> <scenario n> WHO? As a <role> WHAT? I want <feature> WHY? so that <business value> Scenario: <description> Given <preconditions, context> [And] <additional preconditions> When <action, behaviour> Then <postconditions> [And] <additional postconditions>
  • 22. Confidential | Copyright © QAAgility Technologies Pvt Ltd BDD Feature Feature: Depositing money in to a User account Scenario: Depositing money in to User's account should add money to the User's current balance Given a User has valid bank account And a User has $X money in their account When $Y is deposited in to the account Then the balance should be $(X+Y) This is Gherkin
  • 23. Confidential | Copyright © QAAgility Technologies Pvt Ltd Gherkin Gherkin is the language that Cucumber understands. It is a Business Readable, Domain Specific Language that lets you describe software’s behavior without detailing how that behavior is implemented. •Easy to read •Easy to understand •Easy to discuss •Easy to parse
  • 24. Confidential | Copyright © QAAgility Technologies Pvt Ltd How does BDD help? •All stakeholders involve in discussion •Specifications having acceptance tests built into them •As the software evolve the tests also updated •Specifications are about how the system should behave in various scenarios
  • 25. Confidential | Copyright © QAAgility Technologies Pvt Ltd User Story and Scenario Title (one line describing the story) Narrative: As a [role] I want [feature] So that [benefit] Acceptance Criteria: (presented as Scenarios) Scenario 1: Title Given [context] And [some more context]... When [event] Then [outcome] And [another outcome]...
  • 26. Confidential | Copyright © QAAgility Technologies Pvt Ltd Scenarios Story: Account Holder withdraws cash As an Account Holder I want to withdraw cash from an ATM So that I can get money when the bank is closed Scenario 1: Account has sufficient funds Given the account balance is $100 And the card is valid And the machine contains enough money When the Account Holder requests $20 Then the ATM should dispense $20 And the account balance should be $80 And the card should be returned Scenario 2: Account has insufficient funds Given the account balance is $10 And the card is valid And the machine contains enough money When the Account Holder requests $20 Then the ATM should not dispense any money And the ATM should say there are insufficient funds And the account balance should be $20 And the card should be returned Scenario 3: Card has been disabled Given the card is disabled When the Account Holder requests $20 Then the ATM should retain the card And the ATM should say the card has been retained Scenario 4: The ATM has insufficient funds ...
  • 27. Confidential | Copyright © QAAgility Technologies Pvt Ltd Group Exercise •Read the ATA SSC Vision document and the user stories and write the Features in Given- When-Then format
  • 28. Confidential | Copyright © QAAgility Technologies Pvt Ltd Attributes of Good Feature document •Complete •Testable •Specific
  • 29. Confidential | Copyright © QAAgility Technologies Pvt Ltd Thank You. ashish.mishra@qaagility.com in.linkedin.com/in/ash1shm/ www.agiletestingalliance.org www.qaagility.com