Acceptance test styles - Imperative vs Declarative

2,270 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,270
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Command driven,List of instructions, how to do somethingDescribes what to do but not how to do it how
  • 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
  • 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
  • Acceptance test styles - Imperative vs Declarative

    1. 1. Acceptance Test StylesImperative vs DeclarativeLeeds Tester Gathering – April 2013Alan Parkinson
    2. 2. Given a user “alan" exists with password "secret"And I am not logged inWhen I navigate to the home pageThen I am redirected to the login formWhen 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
    3. 3. Given I am an unauthenticated UserWhen I attempt to view some restricted contentThen I am asked to authenticateWhen I authenticate with valid credentialsThen I am shown the restricted content
    4. 4. 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
    5. 5. Questions and Answersalan.parkinson@hindsightsoftware.co.uk@alan_parkinson @TeamHindsightAlan ParkinsonCEO and Co-founder Hindsight Software Ltd

    ×