SlideShare a Scribd company logo
Slav Kurochkin 

Software Engineer

EPIC Loan Systems
Behavior-driven development in Java using
Cucumber-JVM
Cucumber Overview
Part I
2
What is Cucumber?
3
Cucumber is BDD
tool
Cucumber is NOT just a plant
4
A single source of truth
Cucumber merges specification and test documentation into one cohesive whole.
Living documentation
Because they're automatically tested by Cucumber, your specifications are always
bang up-to-date.
Focus on the customer
Business and IT don't always understand each other. Cucumber's executable
specifications encourage closer collaboration, helping teams keep the business goal
in mind at all times.
Less rework
When automated testing is this much fun, teams can easily protect themselves from
costly regressions.
5
So how Cucumber
work?
Business and Technology work together
6
What is the main components of Cucumber and
how to make it grow fast?*
*There is no need for chemicals, just a bit of coding
7
- Feature files written in Gherkin (Given, When Then)
- Step Definitions glue plain english to code using
RegEx
- Configuration file, helping you configure testing
environment (setup, cleanup, outcome)
8
Feature file
• Tag - let us define execution
path

• Feature - name of the the
component we test 

• Description - short description
of what we are testing

• Background - common
behavior for all scenarios

• Scenario - individual test

• Gherkin - Scenario steps
(Given, When, Then)
9
Gherkin
• Given - defines initial state of
testing application

• When - action, invoke
methods, calling API,
interacting with UI layer

• Then - Asserting outcome

• And - helper if Given, When,
Then is not enough
10
Step Definition
• Sketching out the domain
model

• Annotations defines given,
when, then 

• RegEx to glue Feature file to
Java code(or whatever
language you use).
11
Configuration file
• Test setup

• Test cleanup

• Test outcome
12
Cucumber Technical Details
Part II
13
What can you test with Cucumber?
14
• DataBase Testing
• Unit or/and Component Testing
• API Testing using frameworks like RestAssured
• Web UI testing using Selenium WebDriver
15
Technical features of Cucumber
• Run specific tests (using tags)
• Rerun failed tests
• Parametrized tests (data driving tests)
• Reusable steps (steps showing up in predictive way)
• Detailed report (in case of UI testing we can add
screenshot on fail)
• Configurable test
16
Cucumber scenario states
• Failed - scenario failed
• Pending - step definition created but there is no code
implementation yet
• Undefined - there is Gherkin steps, but no step definition
• Skipped - if scenario failed theres is no need to waste
time and executing rest of the steps
• Passed - lucky you :)
17
Scenario vs Scenario Outline
18
Cucumber-JVM Test Runners
• JUnit
• CLI runners (Gradle, Maven, Ant etc)
• Android runner
• Third party runners
19
Test Code Examples
(can be found on github)
20
References
• https://cucumber.io/docs
• http://docs.behat.org
• https://relishapp.com
• http://specflow.org/documentation/
• https://www.ibm.com/developerworks/library/a-automating-ria/
• “The Cucumber For Java Book” by Seb Rose, Matt Wynne, & Aslak Helesoy
• “Specification by Example” by Gojko Adzic
• “BDD in Action” by John Ferguson Smart
• Rest-Assured with Cucumber: Using BDD for web services automation https://angiejones.tech/rest-
assured-with-cucumber-using-bdd-for-web-services-automation/ by Angie Jones
• toolsqa.com
21

More Related Content

What's hot

BlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter Presents at the High Performance Drupal MeetupBlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter
 

What's hot (20)

APIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page ObjectsAPIs: A Better Alternative to Page Objects
APIs: A Better Alternative to Page Objects
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
High Performance Snippets
High Performance SnippetsHigh Performance Snippets
High Performance Snippets
 
Client Side Measurement & Performance With Rails
Client Side Measurement & Performance With RailsClient Side Measurement & Performance With Rails
Client Side Measurement & Performance With Rails
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
 
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce LabsHow To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
How To Combine Back-End 
 & Front-End Testing with BlazeMeter & Sauce Labs
 
Cache is King
Cache is KingCache is King
Cache is King
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, Successfully
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance Testing
 
Moving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life StoryMoving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life Story
 
The LAZY Developer's Guide to BDD (with Cucumber)
The LAZY Developer's Guide to BDD (with Cucumber)The LAZY Developer's Guide to BDD (with Cucumber)
The LAZY Developer's Guide to BDD (with Cucumber)
 
Testing Agile Web Services from soapUI
Testing Agile Web Services from soapUITesting Agile Web Services from soapUI
Testing Agile Web Services from soapUI
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
 
Best Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaBest Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin Nikita
 
Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)Crash Course in AngularJS + Ionic (Deep dive)
Crash Course in AngularJS + Ionic (Deep dive)
 
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 -  Fullstack end-to-end Test Automation with node.jsForwardJS 2017 -  Fullstack end-to-end Test Automation with node.js
ForwardJS 2017 - Fullstack end-to-end Test Automation with node.js
 
BlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter Presents at the High Performance Drupal MeetupBlazeMeter Presents at the High Performance Drupal Meetup
BlazeMeter Presents at the High Performance Drupal Meetup
 
Node.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java sideNode.js and Selenium Webdriver, a journey from the Java side
Node.js and Selenium Webdriver, a journey from the Java side
 

Viewers also liked

Release With Maven
Release With MavenRelease With Maven
Release With Maven
eugenn
 
ITIL, Release Management and Automation
ITIL, Release Management and AutomationITIL, Release Management and Automation
ITIL, Release Management and Automation
IBM UrbanCode Products
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Brandon Keepers
 

Viewers also liked (20)

Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Release Manager Data sheet
Release Manager Data sheetRelease Manager Data sheet
Release Manager Data sheet
 
Apereo OAE development and release process
Apereo OAE development and release processApereo OAE development and release process
Apereo OAE development and release process
 
How To Plan a Software Project
How To Plan a Software ProjectHow To Plan a Software Project
How To Plan a Software Project
 
Release process for a project
Release process for a projectRelease process for a project
Release process for a project
 
Kudo codefest : Delivering High Quality Software Through Better Release Process
Kudo codefest : Delivering High Quality Software Through Better Release ProcessKudo codefest : Delivering High Quality Software Through Better Release Process
Kudo codefest : Delivering High Quality Software Through Better Release Process
 
Xen Project Release and Roadmap Process (4.7+)
Xen Project Release and Roadmap Process (4.7+)Xen Project Release and Roadmap Process (4.7+)
Xen Project Release and Roadmap Process (4.7+)
 
Release With Maven
Release With MavenRelease With Maven
Release With Maven
 
Agile Release Planning
Agile Release PlanningAgile Release Planning
Agile Release Planning
 
IT Software - Release cycle & Delivery roadmap
IT Software - Release cycle & Delivery roadmapIT Software - Release cycle & Delivery roadmap
IT Software - Release cycle & Delivery roadmap
 
ITIL, Release Management and Automation
ITIL, Release Management and AutomationITIL, Release Management and Automation
ITIL, Release Management and Automation
 
6 sigma LTE release management process improvement
6 sigma LTE release management process improvement6 sigma LTE release management process improvement
6 sigma LTE release management process improvement
 
10 Benefits of Automated Testing
10 Benefits of Automated Testing10 Benefits of Automated Testing
10 Benefits of Automated Testing
 
Release Management
Release Management Release Management
Release Management
 
Understanding the Agile Release and Sprint Planning Process
Understanding the Agile Release and Sprint Planning Process Understanding the Agile Release and Sprint Planning Process
Understanding the Agile Release and Sprint Planning Process
 
Agile Testing by Example
Agile Testing by ExampleAgile Testing by Example
Agile Testing by Example
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 

Similar to BDD in Java using Cucumber

QUALITY ASSURANCE and VALIDATION ENGINEER
QUALITY ASSURANCE and VALIDATION ENGINEER QUALITY ASSURANCE and VALIDATION ENGINEER
QUALITY ASSURANCE and VALIDATION ENGINEER
Piyush Prakash
 
Automating development-operations-v1
Automating development-operations-v1Automating development-operations-v1
Automating development-operations-v1
Sumanth Vepa
 

Similar to BDD in Java using Cucumber (20)

Behavior Driven Development by Example
Behavior Driven Development by ExampleBehavior Driven Development by Example
Behavior Driven Development by Example
 
Постоянное тестирование интеграции
Постоянное тестирование интеграцииПостоянное тестирование интеграции
Постоянное тестирование интеграции
 
Udvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load testUdvid din test portefølje med coded ui test og cloud load test
Udvid din test portefølje med coded ui test og cloud load test
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
 
Developers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomonDevelopers Testing - Girl Code at bloomon
Developers Testing - Girl Code at bloomon
 
Tdd using Jasmine and karma
Tdd using  Jasmine and karmaTdd using  Jasmine and karma
Tdd using Jasmine and karma
 
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
Automated Virtualized Testing (AVT) with Docker, Kubernetes, WireMock and Gat...
 
Continuous Integration, Deploy, Test From Beginning To End 2014
Continuous Integration, Deploy, Test From Beginning To End 2014Continuous Integration, Deploy, Test From Beginning To End 2014
Continuous Integration, Deploy, Test From Beginning To End 2014
 
Use Jenkins For Continuous Load Testing And Mobile Test Automation
Use Jenkins For Continuous Load Testing And Mobile Test AutomationUse Jenkins For Continuous Load Testing And Mobile Test Automation
Use Jenkins For Continuous Load Testing And Mobile Test Automation
 
Presentation application server diagnostics
Presentation   application server diagnosticsPresentation   application server diagnostics
Presentation application server diagnostics
 
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test AutomationSTARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
STARWest: Use Jenkins For Continuous 
Load Testing And Mobile Test Automation
 
QUALITY ASSURANCE and VALIDATION ENGINEER
QUALITY ASSURANCE and VALIDATION ENGINEER QUALITY ASSURANCE and VALIDATION ENGINEER
QUALITY ASSURANCE and VALIDATION ENGINEER
 
Automating development-operations-v1
Automating development-operations-v1Automating development-operations-v1
Automating development-operations-v1
 
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
 
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
Using BladeRunnerJS to Build Front-End Apps that Scale - Fluent 2014
 
Creating a reasonable project boilerplate
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
 
Agile Engineering Best Practices by Richard Cheng
Agile Engineering Best Practices by Richard ChengAgile Engineering Best Practices by Richard Cheng
Agile Engineering Best Practices by Richard Cheng
 
ABAPCodeRetreat - TDD Intro by Damir Majer
ABAPCodeRetreat - TDD Intro by Damir MajerABAPCodeRetreat - TDD Intro by Damir Majer
ABAPCodeRetreat - TDD Intro by Damir Majer
 
Battle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java ProjectBattle for Code Quality - A Story of One Java Project
Battle for Code Quality - A Story of One Java Project
 
Continuous integration at CartoDB
Continuous integration at CartoDBContinuous integration at CartoDB
Continuous integration at CartoDB
 

Recently uploaded

Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
abhinandnam9997
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
aagad
 

Recently uploaded (12)

Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
The Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI StudioThe Best AI Powered Software - Intellivid AI Studio
The Best AI Powered Software - Intellivid AI Studio
 
The AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdfThe AI Powered Organization-Intro to AI-LAN.pdf
The AI Powered Organization-Intro to AI-LAN.pdf
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
一比一原版UTS毕业证悉尼科技大学毕业证成绩单如何办理
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
Stay Ahead with 2024's Top Web Design Trends
Stay Ahead with 2024's Top Web Design TrendsStay Ahead with 2024's Top Web Design Trends
Stay Ahead with 2024's Top Web Design Trends
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 

BDD in Java using Cucumber

  • 1. Slav Kurochkin Software Engineer EPIC Loan Systems Behavior-driven development in Java using Cucumber-JVM
  • 4. Cucumber is BDD tool Cucumber is NOT just a plant 4
  • 5. A single source of truth Cucumber merges specification and test documentation into one cohesive whole. Living documentation Because they're automatically tested by Cucumber, your specifications are always bang up-to-date. Focus on the customer Business and IT don't always understand each other. Cucumber's executable specifications encourage closer collaboration, helping teams keep the business goal in mind at all times. Less rework When automated testing is this much fun, teams can easily protect themselves from costly regressions. 5
  • 6. So how Cucumber work? Business and Technology work together 6
  • 7. What is the main components of Cucumber and how to make it grow fast?* *There is no need for chemicals, just a bit of coding 7
  • 8. - Feature files written in Gherkin (Given, When Then) - Step Definitions glue plain english to code using RegEx - Configuration file, helping you configure testing environment (setup, cleanup, outcome) 8
  • 9. Feature file • Tag - let us define execution path • Feature - name of the the component we test • Description - short description of what we are testing • Background - common behavior for all scenarios • Scenario - individual test • Gherkin - Scenario steps (Given, When, Then) 9
  • 10. Gherkin • Given - defines initial state of testing application • When - action, invoke methods, calling API, interacting with UI layer • Then - Asserting outcome • And - helper if Given, When, Then is not enough 10
  • 11. Step Definition • Sketching out the domain model • Annotations defines given, when, then • RegEx to glue Feature file to Java code(or whatever language you use). 11
  • 12. Configuration file • Test setup • Test cleanup • Test outcome 12
  • 14. What can you test with Cucumber? 14
  • 15. • DataBase Testing • Unit or/and Component Testing • API Testing using frameworks like RestAssured • Web UI testing using Selenium WebDriver 15
  • 16. Technical features of Cucumber • Run specific tests (using tags) • Rerun failed tests • Parametrized tests (data driving tests) • Reusable steps (steps showing up in predictive way) • Detailed report (in case of UI testing we can add screenshot on fail) • Configurable test 16
  • 17. Cucumber scenario states • Failed - scenario failed • Pending - step definition created but there is no code implementation yet • Undefined - there is Gherkin steps, but no step definition • Skipped - if scenario failed theres is no need to waste time and executing rest of the steps • Passed - lucky you :) 17
  • 18. Scenario vs Scenario Outline 18
  • 19. Cucumber-JVM Test Runners • JUnit • CLI runners (Gradle, Maven, Ant etc) • Android runner • Third party runners 19
  • 20. Test Code Examples (can be found on github) 20
  • 21. References • https://cucumber.io/docs • http://docs.behat.org • https://relishapp.com • http://specflow.org/documentation/ • https://www.ibm.com/developerworks/library/a-automating-ria/ • “The Cucumber For Java Book” by Seb Rose, Matt Wynne, & Aslak Helesoy • “Specification by Example” by Gojko Adzic • “BDD in Action” by John Ferguson Smart • Rest-Assured with Cucumber: Using BDD for web services automation https://angiejones.tech/rest- assured-with-cucumber-using-bdd-for-web-services-automation/ by Angie Jones • toolsqa.com 21