acceptance test styles - imperative vs declarative

Post on 17-May-2015

1.762 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Acceptance Test StylesImperative vs Declarative

Leeds Tester Gathering – April 2013

Alan Parkinson

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 ParkinsonCEO and Co-founder Hindsight Software Ltd

top related