test automation in the hands of "the business"
TRANSCRIPT
Ministry of Testing, Boston
How Specification By Example is Changing How We Plan and Test Our
Solutions
Greg Tutunjian, Enterprise Agile CoachOptum Technology, Boston
January 25, 2017
Test AutomationIn The Hands of “The Business”
Ministry of Testing, Boston
Purpose
Business Testing
Evolution
Business Testing Guidanc
e
Learn More
Agenda
2
Ministry of Testing, Boston
Purpose
3
Ministry of Testing, Boston
Why QA Professionals
4
1. Outside-in Testing (versus inner-loop testing)
1. Solution-centric (versus development-centric)
1. Incrementing Value (versus incrementing feature count)
1. (More) Multidisciplinary (versus usual disciplines)
1. (Finally) Direction-setting (versus waiting)
Ministry of Testing, Boston
Take Away Potential
5
1. Investigate Further
1. Experiment @ Work
1. Engage Other QA (Like-minded) Professionals
1. Community of Practice (versus center of excellence)
1. Advance Adoption
Ministry of Testing, Boston
Greg T Bio
6
1. Application Developer (short lived)
1. Systems Engineer (longer lived)
1. Team Builder (never happier)
1. Agile Delivery Lead (storm, norm, form, deliver)
• Enterprise Agile Coach (delivery focus)
Ministry of Testing, Boston
Experience Informs
7
1975 1980 1985 1990 1995 2000 2005 2010 2016
Getting
To
Done
Application
Developer
Business-side
Testing25%
50%
75%
100%
Innovation
Practices
Form & Lead
Teams
Ken Schwaber
On-site
Solution Architect
Enterprise Agility
Enterprise Culture & Happiness
AgileManifesto
Scaling
Ministry of Testing, Boston
Change (De)Evolutio
n
8
Ministry of Testing, Boston
Satir Change Model
9
Ministry of Testing, Boston
Business Testing Evolution
10
1975 1980 1985 1990 1995 2000 2005 2010 2016
25%
50%
75%
100%
Repeatable?
Add Value?
Transferable?
Cost Effective?
Spec
BRD
Value
Era
Data
Proto
Know Agil
e
BRD Agile
mainframe
minicomputer
client-server
WAN & LAN
smallteams
enterprise agility
Ministry of Testing, Boston
Trust Gap
11
1. Patience
1. Engagement
2. Awareness
3. Feedback
1. Listening
Ministry of Testing, Boston
Business Testing
Guidance12
Ministry of Testing, Boston
• Specification By Example (SBE)A collaboration method for specifying requirements and tests whose benefits include producing correct and reliable documentation, setting expectations clearly and concisely, making validation more efficient and reducing rework.
Definitions
13
Ministry of Testing, Boston
• Acceptance Test Driven Development (ATDD)
A repeatable means of collaboration between the business (or customers), testers and developers to produce testable requirements resulting in higher quality software more frequently.
• Behavior Driven Development (BDD)A more mature means of collaboration (than ATDD) between the business (or customers), testers and developers to produce testable requirements resulting in higher quality software more frequently.
Definitions
14
Ministry of Testing, Boston
Chart A Course
15
1. Focus on high-risk solution areas• Versus starting small & low-risk
1. Work in pairs• Build knowledge & increase confidence
1. Facilitate Workshops• Plan in advance; Amenable business
owner(s)
1. Community of Practice• Share your successes
Ministry of Testing, Boston
Testing Framework
16 Scaled Agile, Inc. 2016
Ministry of Testing, Boston
1. Business-side Tooling:• Gherkin (language & rules)
• Cucumber (command-line translator)
2. Feature: A Gherkin-specified set of scenarios3. Scenario: A list of steps Cucumber will run4. Steps: Step-wise test instructions• Step Definitions: Connection to domain-specific support code• Support Code: Entry points to automation library1. Automation Library: System-behavior outcomes
The Business Writes Code
17
Ministry of Testing, Boston
Flow
18
Project
System
Features
Scenarios
Steps
Step Definitions
Support Code
Automation Library
Business
Facing
Technology
Facing
The Cucumber Book
Ministry of Testing, Boston
Simple Example
19
Feature: Refund itemScenario: Jeff returns a faulty microwave Given Jeff has bought a microwave for $100
And he has a receipt When he returns the microwave Then Jeff should be refunded $100
Gherkin KeywordsData
© Cucumber Limited. All rights reserved.
Ministry of Testing, Boston
Gherkin Syntax
20 © Cucumber Limited. All rights reserved.
• Feature (Individual solution attribute; adds value)
• Scenario (Example composed of steps; an executable specification)
• Steps: Given, When, Then, And, But• Background (Step abstraction for repeated steps)
• Scenario Outline (Scenario abstraction for repeated scenarios)
• Examples (Paired with scenario outline: Data Table)
• Doc Strings: """ (Pass text to a step definition)
• Data Tables: | (Pass list of values to step definition)
• Tags: @ (Group scenarios for Cucumber execution)
• Comments: # (In-line comments)
Ministry of Testing, Boston
Functional Example
21
Scenario Outline: feeding a growing cow Given the cow weighs <weight> kg When we calculate the feeding requirements Then the energy should be <energy> MJ And the protein should be <protein> kg
Examples: | weight | energy | protein | | 450 | 26500 | 215 | | 500 | 29500 | 245 | | 575 | 31500 | 255 | | 600 | 37000 | 305 |
© Cucumber Limited. All rights reserved.
Ministry of Testing, Boston
Step Definitions
22 © Cucumber Limited. All rights reserved.
• Translate plain text Gherkin steps into actions that will interact with the system-under-test
• Each step has a corresponding Step Definition
• Step Definition: Small piece of code with a pattern attached to it.
• The pattern links the step definition to all the matching steps, and the code is what Cucumber will execute when it sees a Gherkin Step.
Ministry of Testing, Boston
Getting Started
23
1. Identify Business Partner & Project
2. Adopt Basic (Business) Scenario (from strategic backlog)
1. Write Step Definitions
1. Establish Technology-facing Flow
1. Coach, Mentor & Train Business
1. Scale To Maximize ROI
Ministry of Testing, Boston
Make It Happen
24
1. Effective and practical video training
1. Partner with a visible & available advocate
1. Partner-driven workshops
1. Coach, Mentor & Train Business
1. Incorporate into strategic plans 6. Don’t forget about ROI
Ministry of Testing, Boston
Learn More
25
Ministry of Testing, Boston
Learn More
26
• Specification By Example: How successful teams deliver the right software, Gojko Adzic
• ATDD by Example: A Practical Guide to Acceptance Test-Driven Development, Markus Garner
Ministry of Testing, Boston
Learn More
27
• Cucumber Recipes: Automate Anything with BDD Tools and Techniques, Ian Dees, Matt Wynne, Aslak Hellesoy
• The Cucumber Book: Behavior-Driven
Development for Testers and Developers, Matt Wyne and Aslak Hellesoy
Ministry of Testing, Boston
Learn More
28
• Satir Change Model:• Virginia Satir Global Network:
https://satirglobal.org • Steven Smith Adaptation:
http://stevenmsmith.com/ar-satir-change-model
• Cucumber Community: https://
cucumber.io
Ministry of Testing, Boston
The End
29
Thank You