SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
@wakaleo
The evolution of automated testing practices
Take me on a journey
@wakaleo
@wakaleo
John
Ferguson
Smart
Introductions
“I help teams of smart people 

learn to work together more efficiently, 

to deliver better software faster”
Alex Soto
Bueno
Introductions
“I like helping open source projects, Java EE advocate and
father of 2 girls”
@wakaleo
Test Automation
Do it well, or don’t do it at all
@wakaleo
Narrative Coding
Style
Open-Closed
Principle
Single
Responsibility
Principle
Separation of
Concerns
Software Engineering Principles can help you write
more maintainable tests
@wakaleo
Separation of Concerns - Layers
Goals
Tasks
Actions
What are you trying to achieve?
What do you need to do to achieve
this goal?
What interactions with the
system do you need for each
task?
@wakaleo
Separation of Concerns - Layers
Scenario: Add a new todo entry on the todo home page

Given I am on the Todo application home page

When I enter 'Buy some milk' into the New Todo field

And I press ENTER

Then the todo list box should contain 'Buy some milk'
@wakaleo
Separation of Concerns - Layers
Scenario: Record a new todo action for future use

Given I need to buy some milk

When I add the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in my todo list
@wakaleo
Feature documentationDetailed feedbackHigh level feedback
Communication and documentation
@wakaleo
Serenity BDD
“Because life is too short to
h a v e t o m a i n t a i n u g l y
automated test suites”
@wakaleo
Living
documentation
Strong Selenium
WebDriver support
JUnit, Cucumber
or JBehave
A layered approach
Serenity BDD
@wakaleo
The Serenity layered architecture
Goals
Tasks
Interactions
Tests or scenarios
“Steps”
Page Objects or other technical
components
@wakaleo
The Serenity layered architecture
Feature: Add new todos

James needs to be able to jot down actions he needs to do as he
thinks of them



Scenario: Record a new todo action for future use

Given James needs to buy some milk

When James adds the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in his todo list
@wakaleo
The Serenity layered architecture
Feature: Add new todos

James needs to be able to jot down actions he needs to do as he
thinks of them



Scenario: Record a new todo action for future use

Given James needs to buy some milk

When James adds the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in his todo list
A goal
@wakaleo
The Serenity layered architecture
Feature: Add new todos

James needs to be able to jot down actions he needs to do as he
thinks of them



Scenario: Record a new todo action for future use

Given James needs to buy some milk

When James adds the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in his todo list
A goal
A task
@wakaleo
The Serenity layered architecture
Feature: Add new todos

James needs to be able to jot down actions he needs to do as he
thinks of them



Scenario: Record a new todo action for future use

Given James needs to buy some milk

When James adds the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in his todo list
A goal
A task
@Steps ATodoUser james;



@When(“^(?:.*) (?:adds|has added) the todo action '(.*)'$")

public void i_add_the_todo_action(String actionName) {

james.adds_an_action_called(actionName);

}
@wakaleo
The Serenity layered architecture
Feature: Add new todos

James needs to be able to jot down actions he needs to do as he
thinks of them



Scenario: Record a new todo action for future use

Given James needs to buy some milk

When James adds the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in his todo list
A goal
A task
@Steps ATodoUser james;



@When(“^(?:.*) (?:adds|has added) the todo action '(.*)'$")

public void i_add_the_todo_action(String actionName) {

james.adds_an_action_called(actionName);

}
The task definition
@wakaleo
The Serenity layered architecture
Feature: Add new todos

James needs to be able to jot down actions he needs to do as he
thinks of them



Scenario: Record a new todo action for future use

Given James needs to buy some milk

When James adds the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in his todo list
A goal
A task
@Steps ATodoUser james;



@When(“^(?:.*) (?:adds|has added) the todo action '(.*)'$")

public void i_add_the_todo_action(String actionName) {

james.adds_an_action_called(actionName);

}
The task definition
TodoPage onTheTodoHomePage;



@Step

public void adds_an_action_called(String actionName) {

onTheTodoHomePage.addAnActionCalled(actionName);

}
@wakaleo
The Serenity layered architecture
Feature: Add new todos

James needs to be able to jot down actions he needs to do as he
thinks of them



Scenario: Record a new todo action for future use

Given James needs to buy some milk

When James adds the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in his todo list
A goal
A task
@Steps ATodoUser james;



@When(“^(?:.*) (?:adds|has added) the todo action '(.*)'$")

public void i_add_the_todo_action(String actionName) {

james.adds_an_action_called(actionName);

}
The task definition
TodoPage onTheTodoHomePage;



@Step

public void adds_an_action_called(String actionName) {

onTheTodoHomePage.addAnActionCalled(actionName);

}
An interaction
@wakaleo
Serenity for Living Documentation
Feature: Add new todos

I need to be able to jot down actions I need to do as fast as I think of them



Scenario: Record a new todo action for future use

Given I need to buy some milk

When I add the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in my todo list
@wakaleo
Serenity for Living Documentation
Feature: Add new todos

I need to be able to jot down actions I need to do as fast as I think of them



Scenario: Record a new todo action for future use

Given I need to buy some milk

When I add the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in my todo list
@wakaleo
Coding demo
@wakaleo
Hard to apply to
Single Page Apps
Need modifications
to extend
Multiple
Responsibilities
Bloat
Page Objects considered harmful
@wakaleo
Introducing the Journey Pattern
@wakaleo
Highly readable
style
Encourages reuse
and maintainable
code
Small, reusable
interaction
components
User-centric
The Journey Pattern
@wakaleo
The Journey Pattern - A User-Centric model
Actors have goals I’d like to be able to recall all
the things I need to do
Meet James
@wakaleo
The Journey Pattern - A User-Centric model
Actors have abilities I can browse the web with my
browser
I can also query REST services
@wakaleo
I’d like to be able to recall all
the things I need to do
The Journey Pattern - A User-Centric model
Actors perform tasks
I’ll add ‘Buy some milk’ to my
todo list
@wakaleo
I’d like to be able to recall all
the things I need to do
The Journey Pattern - A User-Centric model
Actors may interact with the system to
perform these tasks
I’ll add ‘Buy some milk’ to my
todo list
Type ‘Buy the milk’
Press ‘ENTER’
@wakaleo
The Journey Pattern in Serenity
Actors have goals I’d like to be able to recall all
the things I need to do
@wakaleo
The Journey Pattern in Serenity
Actors have goals
Feature: Add new todos

James would like to be able to recall all the things he needs to do



Scenario: Record a new todo action for future use

Given James needs to buy some milk

When James adds the todo action 'Buy some milk'

Then 'Buy some milk' should be recorded in his todo list
I’d like to be able to recall all
the things I need to do
@wakaleo
A User-Centric model
Actors have abilities I can browse the web with my
browser
Actor james = Actor.named(“James");
@Managed

WebDriver hisBrowser;
…
james.can(BrowseTheWeb.with(hisBrowser));
@wakaleo
A User-Centric model
Actors perform tasks I’ll add ‘Buy some milk’ to my
todo list
@Steps

AddItem addATodoItem;
…
james.attemptsTo(addATodoItem.called("Buy some milk"));
@wakaleo
A User-Centric model
Actors perform tasks I’ll add ‘Buy some milk’ to my
todo list
@Steps

AddItem addATodoItem;
…
james.attemptsTo(addATodoItem.called("Buy some milk"));
actor.attemptsTo(

Enter.theValue(thingToDo).into(ToDoList.NEW_TODO_FIELD),

Hit.the(RETURN).keyIn(ToDoList.NEW_TODO_FIELD)

);
@wakaleo
Coding demo
@wakaleo
References
• http://www.serenity-bdd.info

• https://github.com/serenity-bdd/serenity-journey-demo

• http://bit.ly/rg-journey
Alex Soto
Bueno
Questions?
asotobu@gmail.com

@alexsotob

john.smart@wakaleo.com 

wakaleo

http://www.wakaleo.com 

http://www.serenity-bdd.info
@wakaleo
Questions?
John Ferguson Smart
john.smart@wakaleo.com
wakaleo
http://www.wakaleo.com
http://www.serenity-bdd.info

Más contenido relacionado

Destacado

Lean startup for developers conference
Lean startup for developers conferenceLean startup for developers conference
Lean startup for developers conferenceSebastien Arbogast
 
Automated Tests in Agile based on Serenity BDD - Michał Szybalski
Automated Tests in Agile based on Serenity BDD - Michał SzybalskiAutomated Tests in Agile based on Serenity BDD - Michał Szybalski
Automated Tests in Agile based on Serenity BDD - Michał SzybalskiŁódQA
 
LJC 2015 "The Crafty Consultants Guide to DevOps"
LJC 2015 "The Crafty Consultants Guide to DevOps"LJC 2015 "The Crafty Consultants Guide to DevOps"
LJC 2015 "The Crafty Consultants Guide to DevOps"Daniel Bryant
 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testingmalcolmt
 
Serenity BDD Workshop - 9th March 2016
Serenity BDD Workshop - 9th March 2016Serenity BDD Workshop - 9th March 2016
Serenity BDD Workshop - 9th March 2016vodqasg
 
Test Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & ToolsTest Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & ToolsAmit Rawat
 
Behavior Driven Development - Live Webinar
Behavior Driven Development - Live WebinarBehavior Driven Development - Live Webinar
Behavior Driven Development - Live WebinarBelatrix Software
 
Smarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automationSmarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automationRIA RUI Society
 
Model-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next LevelModel-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next LevelBob Binder
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumberDaniel Kummer
 

Destacado (20)

Lean startup for developers conference
Lean startup for developers conferenceLean startup for developers conference
Lean startup for developers conference
 
Automated Tests in Agile based on Serenity BDD - Michał Szybalski
Automated Tests in Agile based on Serenity BDD - Michał SzybalskiAutomated Tests in Agile based on Serenity BDD - Michał Szybalski
Automated Tests in Agile based on Serenity BDD - Michał Szybalski
 
Test automatizzati & serenity bdd
Test automatizzati & serenity bddTest automatizzati & serenity bdd
Test automatizzati & serenity bdd
 
LJC 2015 "The Crafty Consultants Guide to DevOps"
LJC 2015 "The Crafty Consultants Guide to DevOps"LJC 2015 "The Crafty Consultants Guide to DevOps"
LJC 2015 "The Crafty Consultants Guide to DevOps"
 
Selenium basic
Selenium basicSelenium basic
Selenium basic
 
Bdd and-testing
Bdd and-testingBdd and-testing
Bdd and-testing
 
Selenium topic 1- Selenium Basic
Selenium topic 1-  Selenium BasicSelenium topic 1-  Selenium Basic
Selenium topic 1- Selenium Basic
 
BDD in Automation Testing
BDD in Automation TestingBDD in Automation Testing
BDD in Automation Testing
 
Serenity BDD Workshop - 9th March 2016
Serenity BDD Workshop - 9th March 2016Serenity BDD Workshop - 9th March 2016
Serenity BDD Workshop - 9th March 2016
 
Test Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & ToolsTest Automation Frameworks: Assumptions, Concepts & Tools
Test Automation Frameworks: Assumptions, Concepts & Tools
 
Ui BDD Testing
Ui BDD TestingUi BDD Testing
Ui BDD Testing
 
Selenium
SeleniumSelenium
Selenium
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Behavior Driven Development - Live Webinar
Behavior Driven Development - Live WebinarBehavior Driven Development - Live Webinar
Behavior Driven Development - Live Webinar
 
Serenity-BDD training
Serenity-BDD trainingSerenity-BDD training
Serenity-BDD training
 
Selenium topic 3 -Web Driver Basics
Selenium topic 3 -Web Driver BasicsSelenium topic 3 -Web Driver Basics
Selenium topic 3 -Web Driver Basics
 
Basic Selenium Training
Basic Selenium TrainingBasic Selenium Training
Basic Selenium Training
 
Smarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automationSmarter ways to do selenium automation @ work, Selenium, automation
Smarter ways to do selenium automation @ work, Selenium, automation
 
Model-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next LevelModel-based Testing: Taking BDD/ATDD to the Next Level
Model-based Testing: Taking BDD/ATDD to the Next Level
 
BDD testing with cucumber
BDD testing with cucumberBDD testing with cucumber
BDD testing with cucumber
 

Similar a Serenity BDD - from executable specifications to living documentation

TestWorks Conf Serenity BDD in action - John Ferguson Smart
TestWorks Conf Serenity BDD in action - John Ferguson SmartTestWorks Conf Serenity BDD in action - John Ferguson Smart
TestWorks Conf Serenity BDD in action - John Ferguson SmartXebia Nederland BV
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with CucumberBrandon Keepers
 
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made EasySeven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made EasySeven Peaks Speaks
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 
Five events in the life of every WordPress request you should know
Five events in the life of every WordPress request you should knowFive events in the life of every WordPress request you should know
Five events in the life of every WordPress request you should knowCaldera Labs
 
Oa Framework Tutorial
Oa Framework TutorialOa Framework Tutorial
Oa Framework Tutorialnolimit797
 
Behat, Test Driven Framework for BDD by Jeevan Bhushetty
Behat, Test Driven Framework for BDD by Jeevan BhushettyBehat, Test Driven Framework for BDD by Jeevan Bhushetty
Behat, Test Driven Framework for BDD by Jeevan BhushettyAgile Testing Alliance
 
Mobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B ExperimentsMobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B Experimentslacyrhoades
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsKonstantin Kudryashov
 
Powershell to the People #suguk
Powershell to the People #sugukPowershell to the People #suguk
Powershell to the People #sugukChris McKinley
 
Merrill's Journey to CI-CD and Continuous Testing by Ashish Mukherjee
Merrill's Journey to CI-CD and Continuous Testing by Ashish MukherjeeMerrill's Journey to CI-CD and Continuous Testing by Ashish Mukherjee
Merrill's Journey to CI-CD and Continuous Testing by Ashish MukherjeeSauce Labs
 
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018Damien Carbery
 
ScreenPlay Design Patterns for QA Automation
ScreenPlay Design Patterns for QA AutomationScreenPlay Design Patterns for QA Automation
ScreenPlay Design Patterns for QA AutomationCOMAQA.BY
 
Best Practice Testing with Lime 2
Best Practice Testing with Lime 2Best Practice Testing with Lime 2
Best Practice Testing with Lime 2Bernhard Schussek
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Cogapp
 
jQuery Internals + Cool Stuff
jQuery Internals + Cool StuffjQuery Internals + Cool Stuff
jQuery Internals + Cool Stuffjeresig
 
Software Testing
Software TestingSoftware Testing
Software Testingsuperphly
 
Testing C# and ASP.net using Ruby
Testing C# and ASP.net using RubyTesting C# and ASP.net using Ruby
Testing C# and ASP.net using RubyBen Hall
 

Similar a Serenity BDD - from executable specifications to living documentation (19)

TestWorks Conf Serenity BDD in action - John Ferguson Smart
TestWorks Conf Serenity BDD in action - John Ferguson SmartTestWorks Conf Serenity BDD in action - John Ferguson Smart
TestWorks Conf Serenity BDD in action - John Ferguson Smart
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made EasySeven Peaks Speaks - Compose Screenshot Testing Made Easy
Seven Peaks Speaks - Compose Screenshot Testing Made Easy
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
Five events in the life of every WordPress request you should know
Five events in the life of every WordPress request you should knowFive events in the life of every WordPress request you should know
Five events in the life of every WordPress request you should know
 
Oa Framework Tutorial
Oa Framework TutorialOa Framework Tutorial
Oa Framework Tutorial
 
Behat: Beyond the Basics
Behat: Beyond the BasicsBehat: Beyond the Basics
Behat: Beyond the Basics
 
Behat, Test Driven Framework for BDD by Jeevan Bhushetty
Behat, Test Driven Framework for BDD by Jeevan BhushettyBehat, Test Driven Framework for BDD by Jeevan Bhushetty
Behat, Test Driven Framework for BDD by Jeevan Bhushetty
 
Mobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B ExperimentsMobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B Experiments
 
Enabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projectsEnabling agile devliery through enabling BDD in PHP projects
Enabling agile devliery through enabling BDD in PHP projects
 
Powershell to the People #suguk
Powershell to the People #sugukPowershell to the People #suguk
Powershell to the People #suguk
 
Merrill's Journey to CI-CD and Continuous Testing by Ashish Mukherjee
Merrill's Journey to CI-CD and Continuous Testing by Ashish MukherjeeMerrill's Journey to CI-CD and Continuous Testing by Ashish Mukherjee
Merrill's Journey to CI-CD and Continuous Testing by Ashish Mukherjee
 
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
 
ScreenPlay Design Patterns for QA Automation
ScreenPlay Design Patterns for QA AutomationScreenPlay Design Patterns for QA Automation
ScreenPlay Design Patterns for QA Automation
 
Best Practice Testing with Lime 2
Best Practice Testing with Lime 2Best Practice Testing with Lime 2
Best Practice Testing with Lime 2
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
 
jQuery Internals + Cool Stuff
jQuery Internals + Cool StuffjQuery Internals + Cool Stuff
jQuery Internals + Cool Stuff
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Testing C# and ASP.net using Ruby
Testing C# and ASP.net using RubyTesting C# and ASP.net using Ruby
Testing C# and ASP.net using Ruby
 

Último

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 

Último (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

Serenity BDD - from executable specifications to living documentation

  • 1. @wakaleo The evolution of automated testing practices Take me on a journey @wakaleo
  • 2. @wakaleo John Ferguson Smart Introductions “I help teams of smart people 
 learn to work together more efficiently, 
 to deliver better software faster”
  • 3. Alex Soto Bueno Introductions “I like helping open source projects, Java EE advocate and father of 2 girls”
  • 4. @wakaleo Test Automation Do it well, or don’t do it at all
  • 6. @wakaleo Separation of Concerns - Layers Goals Tasks Actions What are you trying to achieve? What do you need to do to achieve this goal? What interactions with the system do you need for each task?
  • 7. @wakaleo Separation of Concerns - Layers Scenario: Add a new todo entry on the todo home page
 Given I am on the Todo application home page
 When I enter 'Buy some milk' into the New Todo field
 And I press ENTER
 Then the todo list box should contain 'Buy some milk'
  • 8. @wakaleo Separation of Concerns - Layers Scenario: Record a new todo action for future use
 Given I need to buy some milk
 When I add the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in my todo list
  • 9. @wakaleo Feature documentationDetailed feedbackHigh level feedback Communication and documentation
  • 10. @wakaleo Serenity BDD “Because life is too short to h a v e t o m a i n t a i n u g l y automated test suites”
  • 11. @wakaleo Living documentation Strong Selenium WebDriver support JUnit, Cucumber or JBehave A layered approach Serenity BDD
  • 12. @wakaleo The Serenity layered architecture Goals Tasks Interactions Tests or scenarios “Steps” Page Objects or other technical components
  • 13. @wakaleo The Serenity layered architecture Feature: Add new todos
 James needs to be able to jot down actions he needs to do as he thinks of them
 
 Scenario: Record a new todo action for future use
 Given James needs to buy some milk
 When James adds the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in his todo list
  • 14. @wakaleo The Serenity layered architecture Feature: Add new todos
 James needs to be able to jot down actions he needs to do as he thinks of them
 
 Scenario: Record a new todo action for future use
 Given James needs to buy some milk
 When James adds the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in his todo list A goal
  • 15. @wakaleo The Serenity layered architecture Feature: Add new todos
 James needs to be able to jot down actions he needs to do as he thinks of them
 
 Scenario: Record a new todo action for future use
 Given James needs to buy some milk
 When James adds the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in his todo list A goal A task
  • 16. @wakaleo The Serenity layered architecture Feature: Add new todos
 James needs to be able to jot down actions he needs to do as he thinks of them
 
 Scenario: Record a new todo action for future use
 Given James needs to buy some milk
 When James adds the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in his todo list A goal A task @Steps ATodoUser james;
 
 @When(“^(?:.*) (?:adds|has added) the todo action '(.*)'$")
 public void i_add_the_todo_action(String actionName) {
 james.adds_an_action_called(actionName);
 }
  • 17. @wakaleo The Serenity layered architecture Feature: Add new todos
 James needs to be able to jot down actions he needs to do as he thinks of them
 
 Scenario: Record a new todo action for future use
 Given James needs to buy some milk
 When James adds the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in his todo list A goal A task @Steps ATodoUser james;
 
 @When(“^(?:.*) (?:adds|has added) the todo action '(.*)'$")
 public void i_add_the_todo_action(String actionName) {
 james.adds_an_action_called(actionName);
 } The task definition
  • 18. @wakaleo The Serenity layered architecture Feature: Add new todos
 James needs to be able to jot down actions he needs to do as he thinks of them
 
 Scenario: Record a new todo action for future use
 Given James needs to buy some milk
 When James adds the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in his todo list A goal A task @Steps ATodoUser james;
 
 @When(“^(?:.*) (?:adds|has added) the todo action '(.*)'$")
 public void i_add_the_todo_action(String actionName) {
 james.adds_an_action_called(actionName);
 } The task definition TodoPage onTheTodoHomePage;
 
 @Step
 public void adds_an_action_called(String actionName) {
 onTheTodoHomePage.addAnActionCalled(actionName);
 }
  • 19. @wakaleo The Serenity layered architecture Feature: Add new todos
 James needs to be able to jot down actions he needs to do as he thinks of them
 
 Scenario: Record a new todo action for future use
 Given James needs to buy some milk
 When James adds the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in his todo list A goal A task @Steps ATodoUser james;
 
 @When(“^(?:.*) (?:adds|has added) the todo action '(.*)'$")
 public void i_add_the_todo_action(String actionName) {
 james.adds_an_action_called(actionName);
 } The task definition TodoPage onTheTodoHomePage;
 
 @Step
 public void adds_an_action_called(String actionName) {
 onTheTodoHomePage.addAnActionCalled(actionName);
 } An interaction
  • 20. @wakaleo Serenity for Living Documentation Feature: Add new todos
 I need to be able to jot down actions I need to do as fast as I think of them
 
 Scenario: Record a new todo action for future use
 Given I need to buy some milk
 When I add the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in my todo list
  • 21. @wakaleo Serenity for Living Documentation Feature: Add new todos
 I need to be able to jot down actions I need to do as fast as I think of them
 
 Scenario: Record a new todo action for future use
 Given I need to buy some milk
 When I add the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in my todo list
  • 23. @wakaleo Hard to apply to Single Page Apps Need modifications to extend Multiple Responsibilities Bloat Page Objects considered harmful
  • 25. @wakaleo Highly readable style Encourages reuse and maintainable code Small, reusable interaction components User-centric The Journey Pattern
  • 26. @wakaleo The Journey Pattern - A User-Centric model Actors have goals I’d like to be able to recall all the things I need to do Meet James
  • 27. @wakaleo The Journey Pattern - A User-Centric model Actors have abilities I can browse the web with my browser I can also query REST services
  • 28. @wakaleo I’d like to be able to recall all the things I need to do The Journey Pattern - A User-Centric model Actors perform tasks I’ll add ‘Buy some milk’ to my todo list
  • 29. @wakaleo I’d like to be able to recall all the things I need to do The Journey Pattern - A User-Centric model Actors may interact with the system to perform these tasks I’ll add ‘Buy some milk’ to my todo list Type ‘Buy the milk’ Press ‘ENTER’
  • 30. @wakaleo The Journey Pattern in Serenity Actors have goals I’d like to be able to recall all the things I need to do
  • 31. @wakaleo The Journey Pattern in Serenity Actors have goals Feature: Add new todos
 James would like to be able to recall all the things he needs to do
 
 Scenario: Record a new todo action for future use
 Given James needs to buy some milk
 When James adds the todo action 'Buy some milk'
 Then 'Buy some milk' should be recorded in his todo list I’d like to be able to recall all the things I need to do
  • 32. @wakaleo A User-Centric model Actors have abilities I can browse the web with my browser Actor james = Actor.named(“James"); @Managed
 WebDriver hisBrowser; … james.can(BrowseTheWeb.with(hisBrowser));
  • 33. @wakaleo A User-Centric model Actors perform tasks I’ll add ‘Buy some milk’ to my todo list @Steps
 AddItem addATodoItem; … james.attemptsTo(addATodoItem.called("Buy some milk"));
  • 34. @wakaleo A User-Centric model Actors perform tasks I’ll add ‘Buy some milk’ to my todo list @Steps
 AddItem addATodoItem; … james.attemptsTo(addATodoItem.called("Buy some milk")); actor.attemptsTo(
 Enter.theValue(thingToDo).into(ToDoList.NEW_TODO_FIELD),
 Hit.the(RETURN).keyIn(ToDoList.NEW_TODO_FIELD)
 );