continuously testing govt.nz using specification by ...continuously testing govt.nz using...

20
Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of Internal Affairs GIS Allen Geer, Principal Consultant, Assurity Consulting Ltd

Upload: others

Post on 17-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Continuously testing govt.nzUsing Specification by Example, BeHat and CircleCI

Amanda Baker, Developer/Tester, Department of Internal Affairs GIS Allen Geer, Principal Consultant, Assurity Consulting Ltd

Page 2: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Government Information Services

Page 3: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Technology

Common Web Platform for Infrastructure

Silverstripe 3 /PHP

Page 4: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

SilverStripe out of date

Customisation

Upgrades high risk

Our challenges

Page 5: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

No automated testing

No test metrics

Manual testing for upgrades

Our challenges

Page 6: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Initial workflow

● Micro-waterfall Agile● Non-Standard Developer Environments

○ (With PHP Stack this is important)● Manual Handoffs to Testing

Page 7: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Micro Waterfall Antipattern

TesterDeveloperProduct Owner

Here’s a User Story Work on It

Im Done With The User Story Now You Test It

I found a defect, Let’s go through this futile exercise again where we hand back off to each other ad infinitum

Testing Found this defect, lets have a conversation about this feature without them to further confuse the matter.

Page 8: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Specification by Example - 3 “Amigos”

Tester

Developer

Product Owner

New feature

Gherkin examples

Automated, executable test cases!

+

=

Page 9: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Continuous Integration - Testing

We want to execute and report upon a suite of unit and behaviour tests

Page 10: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

CI Workflow

Developer

Commits Code

Checks out commit

Executes unit tests Executes BDD tests

Reports results back to

Create Pull Request

Page 11: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Visualise

• Stocktake

• Total of over 300 features (Gazette almost half)

• Tricky date / time driven features

• Used ‘Spec By Example’ to describe each feature

1

Page 12: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

• Couldn’t do everything

• Determine high risk features and focus on those first

• How important is this feature to the product?

• If it breaks will the site still work?

Prioritise

2

Page 13: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of
Page 14: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

• Wrote all features test in the Gherkin syntax

• Which then was living documentation for the team

Given there is a home page with the content

“Welcome to DIA”

When I go to “/”

Then I should see “Welcome to DIA”

Gherkinise

3

Page 15: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Change of mentality to Test Driven Development

Page 16: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Build Quality into development process

Page 17: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Visualisation and Metrics

Culture of Improvement

Page 18: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Path to automation isn’t binary

Page 19: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Involve everyone in the team

Page 20: Continuously testing govt.nz Using Specification by ...Continuously testing govt.nz Using Specification by Example, BeHat and CircleCI Amanda Baker, Developer/Tester, Department of

Automation only works if humanised