SlideShare a Scribd company logo
1 of 30
Behaviour Driven Development
with Cucumber for Java
BDD
Domain Driven Design - DDD
● Common understanding
● Common language
● Test Driven Development - TDD
● Good technical practices
● Small steps
● Combined → Behaviour Driven Development
Test automation
 Test Driven Development, TDD – Develop it the
right way
 Behaviour Driven Development, BDD –
Develop the right thing
Three core principles
• Business and Technology should refer to the same system in
the same way
• Any system should have an identified, verifiable value
• Up-front analysis, design and planning all have a diminishing
return
Common language
Used by all involved
• Customer
• Developers
• Others?
Verifiable value
• Protect revenue
• Increase revenue
• Manage cost
• Increase brand value
• Make the product remarkable
• Provide more value to your customer
Big design up-front
• No big design up-front
• The further you plan ahead, the less accurate you will be
Three questions
• What is the most important thing the system should do?
• What is the next most important thing the system doesn't do
yet?
• If we were to switch off the system, where and what would be
the biggest impact?
Time to create a specification
Time to create a specification
When are we done?
Interpret and translate
 We need to read the spec.
 Understand it
 Translate it into code
 Parse and execute it?
 No, not all specs are created equal
Solution
Write specifications so
 Translations isn't needed
 It is possible to execute them
Format
• Given – Setup the system
• When – Change the state of the system
• Then – Verify the new state
Tools
Audience
Readers
 Customers
 Developers
Maintainers
 Product owner
 Developers
Why Cucumber
 It is one of the least technical tools
 It is a very active open source project
 It supports a variety of languages
A concrete example
Feature: Life of IT guys
In order to get good salary
As a it guy
I want to keep my boss happy
Scenario: I am a tester
Given I am a bad tester
When I go to work
Then I mess with it
And my boss fires me
But the developer likes me
Advantages
The format is
● Easy to read
● Easy to understand
● Easy to discuss
● Easy to parse
Parse and execute
● A parser is developed
● Add native code to implement the steps
 Setup – Given
 Execute – When
 Assert - Then
Write a step definition in Java
@Given("^I am a bad tester$")
public void I_am_a_bad_tester(){
System.out.println("@Given--I am a bad tester");
}
@When("^I go to work$")
public void I_go_to_work(){
System.out.println("@When---I go o work");
}
@Then("^I mess it$")
public void I_mess_with_it(){
System.out.println("@Then--I mess it");
}
@And("^my boss fires me$")
public void my_boss_fires_me(){
System.out.println("@And---my boss fires me");
}
@But("^the developer likes me$")
public void the_developer_likes_me(){
System.out.println("@But--the developer likes me");
Assert.assertTrue(false);
}
Run it and watch it fail
Write code to make the step pass
@Given("^I am a [a-zA-Z]{1,} tester$")
public void I_am_a_bad_tester(){
System.out.println("@Given--I am a bad tester");
}
@When("^I go to work$")
public void I_go_to_work(){
System.out.println("@When---I go o work");
}
@Then("^I [a-zA-Z]{1,} it$")
public void I_mess_with_it(){
System.out.println("@Then--I mess it");
}
@And("^my boss [a-zA-Z]{1,} me$")
public void my_boss_fires_me(){
System.out.println("@And---my boss fires me");
}
@But("^the developer [a-zA-Z]{1,} me$")
public void the_developer_likes_me(){
System.out.println("@But--the developer likes me");
}
Run it again and see the step
pass
Why is Cucumber better
● Compared to well known tools like JUnit?
● It isn't, it's just easier to read for non coders
● The readability has increased
● Communication is easier
Benefits
● Less unnecessary work
● Better regression tests
● Less speculative work
● Less re-work
Maintenance
 Maintained together
● Specs
● Tests
● Code
 Maven
 Continuous Integration, CI
Tips
 Always use the a common language
 Don't over specify – start easy
 Never specify implementation details
Do not focus on tools
• They will never solve the problem
• A fool with a tool is still a fool
Resources
 Cucumber - http://cukes.info/
 Selenium - http://seleniumhq.org/
 Maven - http://maven.apache.org/
 Jenkins - http://jenkins-ci.org/
 Blog -http://thomassundberg.wordpress.com/
Thank You

More Related Content

What's hot

Sql server baselines
Sql server baselinesSql server baselines
Sql server baselinesMike Walsh
 
Never fear, the customizer is here!
Never fear, the customizer is here!Never fear, the customizer is here!
Never fear, the customizer is here!Cameron Jones
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinQA or the Highway
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkinArati Joshi
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit TestingMihail Gaberov
 
Zen And the Art of Test Maintenance Presentation
Zen And the Art of Test Maintenance PresentationZen And the Art of Test Maintenance Presentation
Zen And the Art of Test Maintenance PresentationGil Zilberfeld
 
Unit testing for Grown-ups
Unit testing for Grown-upsUnit testing for Grown-ups
Unit testing for Grown-upsGil Zilberfeld
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
 
WordPress maintenance - Keeping it all running smoothly
WordPress maintenance - Keeping it all running smoothlyWordPress maintenance - Keeping it all running smoothly
WordPress maintenance - Keeping it all running smoothlyKelli Wise
 
Test-driven development with Node.js
Test-driven development with Node.jsTest-driven development with Node.js
Test-driven development with Node.jsMirko Kiefer
 

What's hot (15)

Defensive Apex Programming
Defensive Apex ProgrammingDefensive Apex Programming
Defensive Apex Programming
 
Gherkin model BDD
Gherkin model BDDGherkin model BDD
Gherkin model BDD
 
Gherkin model1
Gherkin model1Gherkin model1
Gherkin model1
 
Sql server baselines
Sql server baselinesSql server baselines
Sql server baselines
 
Never fear, the customizer is here!
Never fear, the customizer is here!Never fear, the customizer is here!
Never fear, the customizer is here!
 
Agile Testing
Agile TestingAgile Testing
Agile Testing
 
Jasmine
JasmineJasmine
Jasmine
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt Eakin
 
Bdd – with cucumber and gherkin
Bdd – with cucumber and gherkinBdd – with cucumber and gherkin
Bdd – with cucumber and gherkin
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
 
Zen And the Art of Test Maintenance Presentation
Zen And the Art of Test Maintenance PresentationZen And the Art of Test Maintenance Presentation
Zen And the Art of Test Maintenance Presentation
 
Unit testing for Grown-ups
Unit testing for Grown-upsUnit testing for Grown-ups
Unit testing for Grown-ups
 
Introduction to Bdd and cucumber
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
 
WordPress maintenance - Keeping it all running smoothly
WordPress maintenance - Keeping it all running smoothlyWordPress maintenance - Keeping it all running smoothly
WordPress maintenance - Keeping it all running smoothly
 
Test-driven development with Node.js
Test-driven development with Node.jsTest-driven development with Node.js
Test-driven development with Node.js
 

Viewers also liked

Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with javaJames Wong
 
Datamining with nb
Datamining with nbDatamining with nb
Datamining with nbJames Wong
 
Andre Childs Journal_of_Raman_Spectroscopy
Andre Childs Journal_of_Raman_SpectroscopyAndre Childs Journal_of_Raman_Spectroscopy
Andre Childs Journal_of_Raman_SpectroscopyAndre Childs
 
Curriculum Vitae ahmed afifi 50446440 new 2016
Curriculum Vitae ahmed afifi 50446440 new 2016Curriculum Vitae ahmed afifi 50446440 new 2016
Curriculum Vitae ahmed afifi 50446440 new 2016Ahmed Afifi
 
Text classification methods
Text classification methodsText classification methods
Text classification methodsLuis Goldster
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherenceJames Wong
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessingHarry Potter
 
Data visualization
Data visualizationData visualization
Data visualizationJames Wong
 
Віртуальна виставка нових надходжень
Віртуальна виставка нових надходженьВіртуальна виставка нових надходжень
Віртуальна виставка нових надходженьГригорий Зубрицкий
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingYoung Alista
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherenceYoung Alista
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching worksYoung Alista
 

Viewers also liked (16)

Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with java
 
Datamining with nb
Datamining with nbDatamining with nb
Datamining with nb
 
Andre Childs Journal_of_Raman_Spectroscopy
Andre Childs Journal_of_Raman_SpectroscopyAndre Childs Journal_of_Raman_Spectroscopy
Andre Childs Journal_of_Raman_Spectroscopy
 
Curriculum Vitae ahmed afifi 50446440 new 2016
Curriculum Vitae ahmed afifi 50446440 new 2016Curriculum Vitae ahmed afifi 50446440 new 2016
Curriculum Vitae ahmed afifi 50446440 new 2016
 
Text classification methods
Text classification methodsText classification methods
Text classification methods
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherence
 
Cheryl Holzknecht Resume 1
Cheryl Holzknecht Resume 1Cheryl Holzknecht Resume 1
Cheryl Holzknecht Resume 1
 
SOA2010 SOA with REST
SOA2010 SOA with RESTSOA2010 SOA with REST
SOA2010 SOA with REST
 
Memory caching
Memory cachingMemory caching
Memory caching
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
 
Data visualization
Data visualizationData visualization
Data visualization
 
Віртуальна виставка нових надходжень
Віртуальна виставка нових надходженьВіртуальна виставка нових надходжень
Віртуальна виставка нових надходжень
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherence
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching works
 

Similar to Behaviour driven development

Beyond TDD: Enabling Your Team to Continuously Deliver Software
Beyond TDD: Enabling Your Team to Continuously Deliver SoftwareBeyond TDD: Enabling Your Team to Continuously Deliver Software
Beyond TDD: Enabling Your Team to Continuously Deliver SoftwareChris Weldon
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven developmentEinar Ingebrigtsen
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018Mike Harris
 
BDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesBDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesSauce Labs
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia eventXebia India
 
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRodrigo Urubatan
 
2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratiehcderaad
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptxAmalEldhose2
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5SSW
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comAviran Mordo
 
Developing a Culture of Quality Code (Midwest PHP 2020)
Developing a Culture of Quality Code (Midwest PHP 2020)Developing a Culture of Quality Code (Midwest PHP 2020)
Developing a Culture of Quality Code (Midwest PHP 2020)Scott Keck-Warren
 
The Challenges & Pitfalls of Database Continuous Delivery
The Challenges & Pitfalls of Database Continuous DeliveryThe Challenges & Pitfalls of Database Continuous Delivery
The Challenges & Pitfalls of Database Continuous DeliveryPerforce
 
Software development best practices & coding guidelines
Software development best practices & coding guidelinesSoftware development best practices & coding guidelines
Software development best practices & coding guidelinesAnkur Goyal
 
MongoDB World 2018: How an Idea Becomes a MongoDB Feature
MongoDB World 2018: How an Idea Becomes a MongoDB FeatureMongoDB World 2018: How an Idea Becomes a MongoDB Feature
MongoDB World 2018: How an Idea Becomes a MongoDB FeatureMongoDB
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019Paulo Clavijo
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentShawn Jones
 

Similar to Behaviour driven development (20)

Beyond TDD: Enabling Your Team to Continuously Deliver Software
Beyond TDD: Enabling Your Team to Continuously Deliver SoftwareBeyond TDD: Enabling Your Team to Continuously Deliver Software
Beyond TDD: Enabling Your Team to Continuously Deliver Software
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven development
 
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
How I Learned to Stop Worrying and Love Legacy Code - Ox:Agile 2018
 
BDD Primer
BDD PrimerBDD Primer
BDD Primer
 
BDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User StoriesBDD Selenium for Agile Teams - User Stories
BDD Selenium for Agile Teams - User Stories
 
Prashant technical practices-tdd for xebia event
Prashant   technical practices-tdd for xebia eventPrashant   technical practices-tdd for xebia event
Prashant technical practices-tdd for xebia event
 
Agile
AgileAgile
Agile
 
Introduction to Software Engineering
Introduction to Software EngineeringIntroduction to Software Engineering
Introduction to Software Engineering
 
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDD
 
2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie2014 11 20 Drupal 7 -> 8 test migratie
2014 11 20 Drupal 7 -> 8 test migratie
 
{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx{10.0} Test Driven Development.pptx
{10.0} Test Driven Development.pptx
 
A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5A modern architecturereview–usingcodereviewtools-ver-3.5
A modern architecturereview–usingcodereviewtools-ver-3.5
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.com
 
Developing a Culture of Quality Code (Midwest PHP 2020)
Developing a Culture of Quality Code (Midwest PHP 2020)Developing a Culture of Quality Code (Midwest PHP 2020)
Developing a Culture of Quality Code (Midwest PHP 2020)
 
The Challenges & Pitfalls of Database Continuous Delivery
The Challenges & Pitfalls of Database Continuous DeliveryThe Challenges & Pitfalls of Database Continuous Delivery
The Challenges & Pitfalls of Database Continuous Delivery
 
Software development best practices & coding guidelines
Software development best practices & coding guidelinesSoftware development best practices & coding guidelines
Software development best practices & coding guidelines
 
MongoDB World 2018: How an Idea Becomes a MongoDB Feature
MongoDB World 2018: How an Idea Becomes a MongoDB FeatureMongoDB World 2018: How an Idea Becomes a MongoDB Feature
MongoDB World 2018: How an Idea Becomes a MongoDB Feature
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019
 
Usable Software Design
Usable Software DesignUsable Software Design
Usable Software Design
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
 

More from James Wong

Multi threaded rtos
Multi threaded rtosMulti threaded rtos
Multi threaded rtosJames Wong
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data miningJames Wong
 
Data mining and knowledge discovery
Data mining and knowledge discoveryData mining and knowledge discovery
Data mining and knowledge discoveryJames Wong
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data miningJames Wong
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching worksJames Wong
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsJames Wong
 
Abstract data types
Abstract data typesAbstract data types
Abstract data typesJames Wong
 
Abstraction file
Abstraction fileAbstraction file
Abstraction fileJames Wong
 
Hardware managed cache
Hardware managed cacheHardware managed cache
Hardware managed cacheJames Wong
 
Abstract class
Abstract classAbstract class
Abstract classJames Wong
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysisJames Wong
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithmsJames Wong
 
Cobol, lisp, and python
Cobol, lisp, and pythonCobol, lisp, and python
Cobol, lisp, and pythonJames Wong
 
Learning python
Learning pythonLearning python
Learning pythonJames Wong
 

More from James Wong (20)

Data race
Data raceData race
Data race
 
Multi threaded rtos
Multi threaded rtosMulti threaded rtos
Multi threaded rtos
 
Recursion
RecursionRecursion
Recursion
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data mining
 
Data mining and knowledge discovery
Data mining and knowledge discoveryData mining and knowledge discovery
Data mining and knowledge discovery
 
Cache recap
Cache recapCache recap
Cache recap
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data mining
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching works
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessors
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Abstraction file
Abstraction fileAbstraction file
Abstraction file
 
Hardware managed cache
Hardware managed cacheHardware managed cache
Hardware managed cache
 
Object model
Object modelObject model
Object model
 
Abstract class
Abstract classAbstract class
Abstract class
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Cobol, lisp, and python
Cobol, lisp, and pythonCobol, lisp, and python
Cobol, lisp, and python
 
Inheritance
InheritanceInheritance
Inheritance
 
Api crash
Api crashApi crash
Api crash
 
Learning python
Learning pythonLearning python
Learning python
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Behaviour driven development

  • 2. BDD Domain Driven Design - DDD ● Common understanding ● Common language ● Test Driven Development - TDD ● Good technical practices ● Small steps ● Combined → Behaviour Driven Development
  • 3. Test automation  Test Driven Development, TDD – Develop it the right way  Behaviour Driven Development, BDD – Develop the right thing
  • 4. Three core principles • Business and Technology should refer to the same system in the same way • Any system should have an identified, verifiable value • Up-front analysis, design and planning all have a diminishing return
  • 5. Common language Used by all involved • Customer • Developers • Others?
  • 6. Verifiable value • Protect revenue • Increase revenue • Manage cost • Increase brand value • Make the product remarkable • Provide more value to your customer
  • 7. Big design up-front • No big design up-front • The further you plan ahead, the less accurate you will be
  • 8. Three questions • What is the most important thing the system should do? • What is the next most important thing the system doesn't do yet? • If we were to switch off the system, where and what would be the biggest impact?
  • 9. Time to create a specification
  • 10. Time to create a specification When are we done?
  • 11. Interpret and translate  We need to read the spec.  Understand it  Translate it into code  Parse and execute it?  No, not all specs are created equal
  • 12. Solution Write specifications so  Translations isn't needed  It is possible to execute them
  • 13. Format • Given – Setup the system • When – Change the state of the system • Then – Verify the new state
  • 14. Tools
  • 16. Why Cucumber  It is one of the least technical tools  It is a very active open source project  It supports a variety of languages
  • 17. A concrete example Feature: Life of IT guys In order to get good salary As a it guy I want to keep my boss happy Scenario: I am a tester Given I am a bad tester When I go to work Then I mess with it And my boss fires me But the developer likes me
  • 18. Advantages The format is ● Easy to read ● Easy to understand ● Easy to discuss ● Easy to parse
  • 19. Parse and execute ● A parser is developed ● Add native code to implement the steps  Setup – Given  Execute – When  Assert - Then
  • 20. Write a step definition in Java @Given("^I am a bad tester$") public void I_am_a_bad_tester(){ System.out.println("@Given--I am a bad tester"); } @When("^I go to work$") public void I_go_to_work(){ System.out.println("@When---I go o work"); } @Then("^I mess it$") public void I_mess_with_it(){ System.out.println("@Then--I mess it"); } @And("^my boss fires me$") public void my_boss_fires_me(){ System.out.println("@And---my boss fires me"); } @But("^the developer likes me$") public void the_developer_likes_me(){ System.out.println("@But--the developer likes me"); Assert.assertTrue(false); }
  • 21. Run it and watch it fail
  • 22. Write code to make the step pass @Given("^I am a [a-zA-Z]{1,} tester$") public void I_am_a_bad_tester(){ System.out.println("@Given--I am a bad tester"); } @When("^I go to work$") public void I_go_to_work(){ System.out.println("@When---I go o work"); } @Then("^I [a-zA-Z]{1,} it$") public void I_mess_with_it(){ System.out.println("@Then--I mess it"); } @And("^my boss [a-zA-Z]{1,} me$") public void my_boss_fires_me(){ System.out.println("@And---my boss fires me"); } @But("^the developer [a-zA-Z]{1,} me$") public void the_developer_likes_me(){ System.out.println("@But--the developer likes me"); }
  • 23. Run it again and see the step pass
  • 24. Why is Cucumber better ● Compared to well known tools like JUnit? ● It isn't, it's just easier to read for non coders ● The readability has increased ● Communication is easier
  • 25. Benefits ● Less unnecessary work ● Better regression tests ● Less speculative work ● Less re-work
  • 26. Maintenance  Maintained together ● Specs ● Tests ● Code  Maven  Continuous Integration, CI
  • 27. Tips  Always use the a common language  Don't over specify – start easy  Never specify implementation details
  • 28. Do not focus on tools • They will never solve the problem • A fool with a tool is still a fool
  • 29. Resources  Cucumber - http://cukes.info/  Selenium - http://seleniumhq.org/  Maven - http://maven.apache.org/  Jenkins - http://jenkins-ci.org/  Blog -http://thomassundberg.wordpress.com/