The document discusses how the Department of Internal Affairs GIS implemented Specification by Example, BeHat, and CircleCI to enable continuous testing of govt.nz. It outlines challenges with their previous workflow including a lack of automated testing. Their new process involves specifying features using Gherkin syntax to create executable test cases. This allows for continuous integration where code commits trigger unit and behavior tests to report results.
1. 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
6. Initial workflow
● Micro-waterfall Agile
● Non-Standard Developer Environments
○ (With PHP Stack this is important)
● Manual Handoffs to Testing
7. 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.
8. Specification by Example - 3 “Amigos”
Tester
Developer
Product Owner
New feature
Gherkin examples
Automated, executable test cases!
+
=
9. Continuous Integration - Testing
We want to execute and report upon a suite of unit
and behaviour tests
11. Visualise
• Stocktake
• Total of over 300 features
(Gazette almost half)
• Tricky date / time driven
features
• Used ‘Spec By Example’ to
describe each feature
1
12. • 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
13.
14. • 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
Amanda to talk
Upgrade means there is a risk of breaking stuff, errors are not descriptive enough to find it
Lengthy manual testing process
Gherkin syntax typically begins with GIVEN, WHEN and THEN statements (for those of you familiar with cucumber, its cucumber but for PHP)
The GIVEN statement here sets up a page entry in the silverstripe database
The WHEN statement will use selenium to go to that URL – in this instance the root of the project / the homepage
And finally the THEN statement is verifying that then content set up in silverstipe by the first step is actually being displayed on the front end and that everything is rendering properly
Good example: We had a tester join the team who was able to come in and read the scripts, and revalidate them, add to them etc.
Amanda to talk – what we learnt
Through our process we learnt that automation isn’t binary (manual / automated) and that by writing manual tests in the gherkin language (upskilling the team to write tests in this way) meant that when it came time to automate them – they were already 70% of the way there. Just needed to tweak a few things here and there (provide example?)
So we discovered a sort of half way point
What we also found is that people are more likely to get on board the new process and work towards an outcome if they feel they are involved. So the process of automating needs to be humanised. So it wasn’t just a lift and shift type change – but it was adapted in a way to increase the liklihood of acceptance by the team. So that there is support and people involved and people didn’t reject the idea.
Amanda to talk – what we learnt
Through our process we learnt that automation isn’t binary (manual / automated) and that by writing manual tests in the gherkin language (upskilling the team to write tests in this way) meant that when it came time to automate them – they were already 70% of the way there. Just needed to tweak a few things here and there (provide example?)
So we discovered a sort of half way point
What we also found is that people are more likely to get on board the new process and work towards an outcome if they feel they are involved. So the process of automating needs to be humanised. So it wasn’t just a lift and shift type change – but it was adapted in a way to increase the liklihood of acceptance by the team. So that there is support and people involved and people didn’t reject the idea.
Amanda to talk – what we learnt
Through our process we learnt that automation isn’t binary (manual / automated) and that by writing manual tests in the gherkin language (upskilling the team to write tests in this way) meant that when it came time to automate them – they were already 70% of the way there. Just needed to tweak a few things here and there (provide example?)
So we discovered a sort of half way point
What we also found is that people are more likely to get on board the new process and work towards an outcome if they feel they are involved. So the process of automating needs to be humanised. So it wasn’t just a lift and shift type change – but it was adapted in a way to increase the liklihood of acceptance by the team. So that there is support and people involved and people didn’t reject the idea.