SlideShare a Scribd company logo
Acceptance Test Styles
Imperative vs Declarative
Leeds Tester Gathering – April 2013
Alan Parkinson
Acceptance test styles - Imperative vs Declarative
Acceptance test styles - Imperative vs Declarative
Given a user “alan" exists with password "secret"
And I am not logged in
When I navigate to the home page
Then I am redirected to the login form
When I enter the “username” with “alan”
And I enter the “password” with “secret”
And I press “login”
Then I am redirected to the home page
Given I am an unauthenticated User
When I attempt to view some restricted content
Then I am asked to authenticate
When I authenticate with valid credentials
Then I am shown the restricted content
Summary
• Write in the Declarative style
– Your scenario doesn’t become brittle
– The business will read it
• Avoid unnecessary detail
– Don’t tie your scenario to the UI
– Using sensible default values
– Override the defaults where required
Questions and Answers
alan.parkinson@hindsightsoftware.co.uk
@alan_parkinson @TeamHindsight
Alan Parkinson
CEO and Co-founder Hindsight Software Ltd

More Related Content

PDF
APIs: A Better Alternative to Page Objects
PPTX
Why we used Feature Branching
PPT
Gear Testers , CNC Gear Measuring Machines , Automatic inspection system for ...
PDF
Gear and Screw measurement
PDF
Comparators, Surface Flatness, Surface Roughness,
PPTX
Gear measurements
PPTX
Test Data Builder Pattern
PPTX
Testing requirements with BDD
APIs: A Better Alternative to Page Objects
Why we used Feature Branching
Gear Testers , CNC Gear Measuring Machines , Automatic inspection system for ...
Gear and Screw measurement
Comparators, Surface Flatness, Surface Roughness,
Gear measurements
Test Data Builder Pattern
Testing requirements with BDD

More from Alan Parkinson (11)

PPTX
Baking in the cloud with packer and puppet
PPTX
Decapitating Selenium with JavaScript
PPTX
Pull requests and testers can be friends
PPTX
What is Continuous Delivery?
PPTX
Cross browser Testing JavaScript
PPTX
Test automation with Cucumber-JVM
PPTX
A Quick overview of Behaviour Driven Development (BDD)
PPTX
Cross-browser unit testing JavaScript
PPTX
Creating data with the test data builder pattern
PPTX
Continuous Deployment Pipeline with maven
PPTX
Feature branching a release day painkiller
Baking in the cloud with packer and puppet
Decapitating Selenium with JavaScript
Pull requests and testers can be friends
What is Continuous Delivery?
Cross browser Testing JavaScript
Test automation with Cucumber-JVM
A Quick overview of Behaviour Driven Development (BDD)
Cross-browser unit testing JavaScript
Creating data with the test data builder pattern
Continuous Deployment Pipeline with maven
Feature branching a release day painkiller
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Approach and Philosophy of On baking technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
cuic standard and advanced reporting.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Modernizing your data center with Dell and AMD
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Big Data Technologies - Introduction.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Unlocking AI with Model Context Protocol (MCP)
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
Approach and Philosophy of On baking technology
MYSQL Presentation for SQL database connectivity
Per capita expenditure prediction using model stacking based on satellite ima...
Diabetes mellitus diagnosis method based random forest with bat algorithm
cuic standard and advanced reporting.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Reach Out and Touch Someone: Haptics and Empathic Computing
Modernizing your data center with Dell and AMD
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Network Security Unit 5.pdf for BCA BBA.
Big Data Technologies - Introduction.pptx
Empathic Computing: Creating Shared Understanding
Encapsulation_ Review paper, used for researhc scholars
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Ad

Acceptance test styles - Imperative vs Declarative

  • 1. Acceptance Test Styles Imperative vs Declarative Leeds Tester Gathering – April 2013 Alan Parkinson
  • 4. Given a user “alan" exists with password "secret" And I am not logged in When I navigate to the home page Then I am redirected to the login form When I enter the “username” with “alan” And I enter the “password” with “secret” And I press “login” Then I am redirected to the home page
  • 5. Given I am an unauthenticated User When I attempt to view some restricted content Then I am asked to authenticate When I authenticate with valid credentials Then I am shown the restricted content
  • 6. Summary • Write in the Declarative style – Your scenario doesn’t become brittle – The business will read it • Avoid unnecessary detail – Don’t tie your scenario to the UI – Using sensible default values – Override the defaults where required
  • 7. Questions and Answers alan.parkinson@hindsightsoftware.co.uk @alan_parkinson @TeamHindsight Alan Parkinson CEO and Co-founder Hindsight Software Ltd

Editor's Notes

  • #4: Command driven,List of instructions, how to do somethingDescribes what to do but not how to do it how
  • #5: Boring - doesn’t engage the business peopleTied to the UI Brittle to UI changes Mobile, thick client, Web appBrittle to implementation changes Change the authentication mechanism
  • #6: Easy to read – The business will get involved – They can write this!No longer tied to the UI UI changes can be updated in the steps or Page Object pattern Reuse across different UI’s - Mobile, thick client, Web appNo longer brittle to implementation changes Change the authentication mechanism