SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
Getting Started with TDD/BDD: The Quality
Process Does Not Improvise
Katy García Bedoya. Tech Lead Test Automation Engineer
Deiny Johana Betancourt. QC Analyst
TAE week - 2018
Schedule
● Introducing Behavior-Driven Development
● A Gherkin primer
● BDD — Best Practices
● Key benefits of BDD / Disadvantages and potential challenges
of BDD
● Demo
Figure 1.1 The traditional development process provides many opportunities for
misunderstandings and miscommunication.
Figure 1.2. BDD uses conversations around examples, expressed in a form that
can be easily automated, to reduce lost information and misunderstandings.
Behavior-Driven Development (BDD) is a set of software
engineering practices designed to help teams build and
deliver more valuable, higher quality software faster.
But most importantly, BDD provides a common language
based on simple, structured sentences expressed in English
(or in the native language of the stakeholders) that facilitate
communication between project team members and business
stakeholders.
Introducing Behavior-Driven Development
BDD was originally designed as an improved version of TDD
Figure 1.3. Test-Driven Development relles on a simple, three-phase cycle.
Introducing Behavior-Driven Development
public class WhenTransferringInternationalFunds
{
@Test
public void
should_transfer_funds_to_a_local_account()
{...}
@Test
public void
should_transfer_funds_to_a_different_bank()
{...}
...
@Test
public void
should_deduct_fees_as_a_separate_transaction()
{...}
...
}
public class
BankAccountTest {
@Test
public void testTransfer()
{...}
@Test
public void testDeposit()
{...}
}
Figure 1.4. The principal activities and outcomes of BDD.
High-level and low-level
executable specifications are
typically implemented using
different tool sets.
Scenario Outline: Earning interest
Given I have an account of type <account-type> with a balance of <initial-balance>
When the monthly interest is calculated
Then I should have earned at an annual interest rate of <interest-rate>
And I should have a new balance of <new-balance>
Examples:
A Gherkin primer
initial-balance account-type interest-rate new-balance
10000 current 1 10008.33
10000 savings 3 10025
10000 supersaver 5 10041.67
BDD — Best Practices
Points to take care for “Feature files”:
● Avoid long descriptions
● Chose a single format all across your features
● Focus on features that deliver business value
● Work together to specify features
Points to take care for “Scenarios and steps”:
● Think of Scenario Or Scenario Outline
● Keep scenarios short by hiding implementation details
● Use Given-When-Then in the right order
● Make Scenarios Atomic
● Cover both the happy and non-happy paths
● Use declarative steps rather than imperative
Good Example (Declarative):
Scenario: Login
Given I have user credentials
When Sign in
Then I should see the user is
signed in
As you can see, using declarative steps
in the scenario makes it shorter and
more readable.
Bad Example (Imperative):
Scenario: Login
Given I am on the login page
When I fill “username” with “ABC”
And I fill password with “XYZ”
And I checked the “Remember Me”
checkbox
And I click on the “Submit” button
Then I should log into the system
And I should see then ‘Welcome’
message
Points to take care for “Tags”:
How to decide name of the tag
Use only relevant tags when there is a necessity else managing tags will become add-on task
and overhead.).
Frequency of Execution: @daily, @hourly, @nightly
Dependencies: @database, @fixtures, @local, @proxy
Progress: @wip, @todo, @implemented, @blocked
Level: @functional, @acceptance, @smoke, @sanity
Environment: @integration, @test, @stage, @live
Tag your feature smartly
Don’t tag a scenario with the same tag used for
tagging feature
If you tag an entire feature then any scenarios within the feature
automatically inherit this tag. Don’t use too many unnecessary tags in the
project, as this will overcomplicated your feature files.
For example, you could tag a feature with the story number in a
bug tracking system like JIRA.
Ex:
@Jira-story #PROJ-33
Key benefits of BDD
● Reduced waste
● Reduced costs
● Easier and safer changes
(Living documentation)
● Faster releases
● BDD requires high business
engagement and collaboration
● BDD works best in an Agile or
iterative context
● Poorly written tests can lead to
higher test-maintenance costs
Disadvantages and potential
challenges of BDD
TDD/BDD: The Quality Process Does Not Improvise
TDD/BDD: The Quality Process Does Not Improvise

Contenu connexe

Similaire à TDD/BDD: The Quality Process Does Not Improvise

Intalio Project Dogfood And Doubleshot
Intalio Project Dogfood And DoubleshotIntalio Project Dogfood And Doubleshot
Intalio Project Dogfood And Doubleshot
Tomoaki Sawada
 

Similaire à TDD/BDD: The Quality Process Does Not Improvise (20)

ABC of Agile (Scrum & Extreme Programming)
ABC of Agile (Scrum & Extreme Programming)ABC of Agile (Scrum & Extreme Programming)
ABC of Agile (Scrum & Extreme Programming)
 
Agile practices for management
Agile practices for managementAgile practices for management
Agile practices for management
 
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh EastmanBehavior Driven Development—A Guide to Agile Practices by Josh Eastman
Behavior Driven Development—A Guide to Agile Practices by Josh Eastman
 
MeasureCamp 2022: Digital Analytics Solutions for 2022
MeasureCamp 2022: Digital Analytics Solutions for 2022MeasureCamp 2022: Digital Analytics Solutions for 2022
MeasureCamp 2022: Digital Analytics Solutions for 2022
 
Moving to tdd bdd
Moving to tdd bddMoving to tdd bdd
Moving to tdd bdd
 
Behaviour driven development aka bdd
Behaviour driven development aka bddBehaviour driven development aka bdd
Behaviour driven development aka bdd
 
Intalio Project Dogfood And Doubleshot
Intalio Project Dogfood And DoubleshotIntalio Project Dogfood And Doubleshot
Intalio Project Dogfood And Doubleshot
 
Project scope preparation
Project scope preparationProject scope preparation
Project scope preparation
 
Managing requirements with user stories
Managing requirements with user storiesManaging requirements with user stories
Managing requirements with user stories
 
Topic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolutionTopic tdd-and-bdd b4usolution
Topic tdd-and-bdd b4usolution
 
Managing an Experimentation Platform by LinkedIn Product Leader
Managing an Experimentation Platform by LinkedIn Product LeaderManaging an Experimentation Platform by LinkedIn Product Leader
Managing an Experimentation Platform by LinkedIn Product Leader
 
Scrum in One Day
Scrum in One DayScrum in One Day
Scrum in One Day
 
Product Backlog Mapping
Product Backlog MappingProduct Backlog Mapping
Product Backlog Mapping
 
Agile sdlc
Agile sdlcAgile sdlc
Agile sdlc
 
Scrum introduc.ppt
Scrum introduc.pptScrum introduc.ppt
Scrum introduc.ppt
 
Benefits of Agile Software Development for Senior Management
Benefits of Agile Software Development for Senior ManagementBenefits of Agile Software Development for Senior Management
Benefits of Agile Software Development for Senior Management
 
Exploratory Testing As Code Eurostar23
Exploratory Testing As Code Eurostar23Exploratory Testing As Code Eurostar23
Exploratory Testing As Code Eurostar23
 
Exploratory Testing As Code
Exploratory Testing As CodeExploratory Testing As Code
Exploratory Testing As Code
 
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
Webinar-From user stories to automated acceptance tests with BDD-Eduardo RiolWebinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
Webinar-From user stories to automated acceptance tests with BDD-Eduardo Riol
 
Scrum Process Overview
Scrum Process OverviewScrum Process Overview
Scrum Process Overview
 

Plus de Globant

Navegando el desafío de transformación digital de los servicios financieros
Navegando el desafío de transformación digital de los servicios financierosNavegando el desafío de transformación digital de los servicios financieros
Navegando el desafío de transformación digital de los servicios financieros
Globant
 

Plus de Globant (20)

Webinar MLOps: When AA gets serious.
Webinar MLOps: When AA gets serious.Webinar MLOps: When AA gets serious.
Webinar MLOps: When AA gets serious.
 
Google Cloud Spanner y NewSQL
Google Cloud Spanner y NewSQLGoogle Cloud Spanner y NewSQL
Google Cloud Spanner y NewSQL
 
Eventos Asíncronos como estrategia virtual
Eventos Asíncronos como estrategia virtualEventos Asíncronos como estrategia virtual
Eventos Asíncronos como estrategia virtual
 
Cultura y valores 4.0 para líderes 4.0
Cultura y valores 4.0 para líderes 4.0Cultura y valores 4.0 para líderes 4.0
Cultura y valores 4.0 para líderes 4.0
 
Tech Insiders Salesforce: SFDX e Integración Continua
Tech Insiders Salesforce: SFDX e Integración ContinuaTech Insiders Salesforce: SFDX e Integración Continua
Tech Insiders Salesforce: SFDX e Integración Continua
 
Como impulsar tu carrera Salesforce
Como impulsar tu carrera SalesforceComo impulsar tu carrera Salesforce
Como impulsar tu carrera Salesforce
 
3D Programming Basics: WebGL
3D Programming Basics: WebGL3D Programming Basics: WebGL
3D Programming Basics: WebGL
 
Converge augmented report
Converge augmented reportConverge augmented report
Converge augmented report
 
Sistema de recomendación entiempo real usando Delta Lake
Sistema de recomendación entiempo real usando Delta LakeSistema de recomendación entiempo real usando Delta Lake
Sistema de recomendación entiempo real usando Delta Lake
 
Kubeflow: Machine Learning en Cloud para todos
Kubeflow: Machine Learning en Cloud para todosKubeflow: Machine Learning en Cloud para todos
Kubeflow: Machine Learning en Cloud para todos
 
Orquestando Pipelines de Datosen AWS con Step Function y AWS Glue
Orquestando Pipelines de Datosen AWS con Step Function y AWS GlueOrquestando Pipelines de Datosen AWS con Step Function y AWS Glue
Orquestando Pipelines de Datosen AWS con Step Function y AWS Glue
 
Apache Beam: Lote portátil y procesamiento de transmisión
Apache Beam: Lote portátil y procesamiento de transmisiónApache Beam: Lote portátil y procesamiento de transmisión
Apache Beam: Lote portátil y procesamiento de transmisión
 
Navegando el desafío de transformación digital de los servicios financieros
Navegando el desafío de transformación digital de los servicios financierosNavegando el desafío de transformación digital de los servicios financieros
Navegando el desafío de transformación digital de los servicios financieros
 
Converge 2020
Converge 2020 Converge 2020
Converge 2020
 
Converge 2020
Converge 2020Converge 2020
Converge 2020
 
Tendencias de tecnología para el recién egresado
Tendencias de tecnología para el recién egresadoTendencias de tecnología para el recién egresado
Tendencias de tecnología para el recién egresado
 
SRE: ¿Qué es y cómo gestionar el Toil?
SRE: ¿Qué es y cómo gestionar el Toil?SRE: ¿Qué es y cómo gestionar el Toil?
SRE: ¿Qué es y cómo gestionar el Toil?
 
Monitoreo en tiempo real para la mejora continua de una aplicación
Monitoreo en tiempo real para la mejora continua de una aplicaciónMonitoreo en tiempo real para la mejora continua de una aplicación
Monitoreo en tiempo real para la mejora continua de una aplicación
 
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?¿Cómo automatizar pruebas de infraestructura y no morir en el intento?
¿Cómo automatizar pruebas de infraestructura y no morir en el intento?
 
Automatización en AWS con Chatbot Serverless (Amazon Lex)
Automatización en AWS con Chatbot Serverless (Amazon Lex)Automatización en AWS con Chatbot Serverless (Amazon Lex)
Automatización en AWS con Chatbot Serverless (Amazon Lex)
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
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
Victor Rentea
 
+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 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
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+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...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

TDD/BDD: The Quality Process Does Not Improvise

  • 1. Getting Started with TDD/BDD: The Quality Process Does Not Improvise Katy García Bedoya. Tech Lead Test Automation Engineer Deiny Johana Betancourt. QC Analyst TAE week - 2018
  • 2. Schedule ● Introducing Behavior-Driven Development ● A Gherkin primer ● BDD — Best Practices ● Key benefits of BDD / Disadvantages and potential challenges of BDD ● Demo
  • 3. Figure 1.1 The traditional development process provides many opportunities for misunderstandings and miscommunication.
  • 4. Figure 1.2. BDD uses conversations around examples, expressed in a form that can be easily automated, to reduce lost information and misunderstandings.
  • 5. Behavior-Driven Development (BDD) is a set of software engineering practices designed to help teams build and deliver more valuable, higher quality software faster. But most importantly, BDD provides a common language based on simple, structured sentences expressed in English (or in the native language of the stakeholders) that facilitate communication between project team members and business stakeholders. Introducing Behavior-Driven Development
  • 6. BDD was originally designed as an improved version of TDD Figure 1.3. Test-Driven Development relles on a simple, three-phase cycle.
  • 7. Introducing Behavior-Driven Development public class WhenTransferringInternationalFunds { @Test public void should_transfer_funds_to_a_local_account() {...} @Test public void should_transfer_funds_to_a_different_bank() {...} ... @Test public void should_deduct_fees_as_a_separate_transaction() {...} ... } public class BankAccountTest { @Test public void testTransfer() {...} @Test public void testDeposit() {...} }
  • 8. Figure 1.4. The principal activities and outcomes of BDD. High-level and low-level executable specifications are typically implemented using different tool sets.
  • 9. Scenario Outline: Earning interest Given I have an account of type <account-type> with a balance of <initial-balance> When the monthly interest is calculated Then I should have earned at an annual interest rate of <interest-rate> And I should have a new balance of <new-balance> Examples: A Gherkin primer initial-balance account-type interest-rate new-balance 10000 current 1 10008.33 10000 savings 3 10025 10000 supersaver 5 10041.67
  • 10. BDD — Best Practices Points to take care for “Feature files”: ● Avoid long descriptions ● Chose a single format all across your features ● Focus on features that deliver business value ● Work together to specify features Points to take care for “Scenarios and steps”: ● Think of Scenario Or Scenario Outline ● Keep scenarios short by hiding implementation details ● Use Given-When-Then in the right order ● Make Scenarios Atomic ● Cover both the happy and non-happy paths ● Use declarative steps rather than imperative
  • 11. Good Example (Declarative): Scenario: Login Given I have user credentials When Sign in Then I should see the user is signed in As you can see, using declarative steps in the scenario makes it shorter and more readable. Bad Example (Imperative): Scenario: Login Given I am on the login page When I fill “username” with “ABC” And I fill password with “XYZ” And I checked the “Remember Me” checkbox And I click on the “Submit” button Then I should log into the system And I should see then ‘Welcome’ message
  • 12. Points to take care for “Tags”: How to decide name of the tag Use only relevant tags when there is a necessity else managing tags will become add-on task and overhead.). Frequency of Execution: @daily, @hourly, @nightly Dependencies: @database, @fixtures, @local, @proxy Progress: @wip, @todo, @implemented, @blocked Level: @functional, @acceptance, @smoke, @sanity Environment: @integration, @test, @stage, @live
  • 13. Tag your feature smartly Don’t tag a scenario with the same tag used for tagging feature If you tag an entire feature then any scenarios within the feature automatically inherit this tag. Don’t use too many unnecessary tags in the project, as this will overcomplicated your feature files. For example, you could tag a feature with the story number in a bug tracking system like JIRA. Ex: @Jira-story #PROJ-33
  • 14. Key benefits of BDD ● Reduced waste ● Reduced costs ● Easier and safer changes (Living documentation) ● Faster releases ● BDD requires high business engagement and collaboration ● BDD works best in an Agile or iterative context ● Poorly written tests can lead to higher test-maintenance costs Disadvantages and potential challenges of BDD