SlideShare a Scribd company logo
1 of 85
Download to read offline
1
Making Test
Automation Work in
Agile Projects
ØREDEV 2012
Lisa Crispin
With Material from Janet Gregory
2
Introductions: Experience, Goals
§  Form groups:
§  New to automation
§  One to two years experience w/ automation
§  More than two years experience
§  Talk with at least two other people
§  Tell each other your learning goals for today
§  Note the most interesting one you hear
Copyright 2012: Lisa Crispin
3
About me…
Programmer, tester, agile team member
Copyright 2012: Lisa Crispin
4
Introduction - You
Copyright 2012: Lisa Crispin
5
Vive la Rebellion!
Successful test automation is an innovation!
•  Let go of traditional roles, reach across them
•  Visualize how tests should look
•  Be smart about when to automate
•  Experiment to overcome obstacles
•  Find/build the right tools
6
Exercise: Your Learning Goals
§  Write one interesting learning goal you heard
from another participant at the start of the
class on a sticky note.
§  Write your number one learning goal for
today on a sticky note.
§  Put the sticky notes on your “learning goals”
sheet
§  Group similar ones together
Copyright 2012: Lisa Crispin
7
Let’s start by defining “agile”
Agile teams:
q  Deliver business value
frequently
q  at a sustainable pace
q  while adapting to the changing
needs of the business
Source: Elisabeth Hendrickson
Copyright 2012: Lisa Crispin
8
The key is “sustainable pace”
Technical debt slows us down
Copyright 2012: Lisa Crispin
High technical debt +
insufficient automation = even
less time
Copyright 2012: Lisa Crispin
10
Barriers to Test Automation
What’s holding you back?
Copyright 2012: Lisa Crispin
11
Exercise: Your barriers
Individually and silently – write one barrier
hindering your team per sticky note
Put these on the “impediments” wall chart
for your table group
Talk to your fellow group members – do you
see any patterns?
Copyright 2012: Lisa Crispin
12
Questions?
Copyright 2012: Lisa Crispin
13
The Whole-Team Approach
§  Automated tests are code
§  Respecting the tests
§  Collaborating
§  Commitment to quality
§  Return on investment
Copyright 2012: Lisa Crispin
14
Automated tests are code
public class CalculatorFixture extends
ColumnFixture {
public String startDate;
public String endDate;
public double startBalance;
public double endBalance;
public String irrTarget;
private Calculator calculator = new
Calculator();
private Double irr;
Source: Gojko Adzic, StarEast 2011 keynote
Source: Gojko Adzic, StarEast 2011 keynote
Copyright 2012: Lisa Crispin
17
Testers are especially good at…
§ Eliciting examples
§ Turning them into tests
§ Ensuring the right testing gets done
§ Exploratory testing
18
Give testers time to do what we do best
How?
19
The Whole-Team Approach
Copyright 2012: Lisa Crispin
20
Experiment: Iteration 1
§  Pair up: one will be tester, one programmer
§  Sit back to back so you face away from each
other
§  Tester gets a drawing which needs to be
replicated
§  Tester tells the programmer what to draw, all at
one time.
§  Programmer draws the shapes based on what
the tester explained.
§  No talking during ‘coding’!
§  Tester “tests” the drawing, reports “bugs” on index
cards
§  Programmer fixes the “bugs”
§  How long did it take? Will the customer be
happy?
Copyright 2012: Lisa Crispin
21
Experiment: Iteration 2
§  Collaborate!
§  Tester tells programmer what to draw, watches
the programmer draw, answers questions, points
out ‘defects’ for programmer to fix immediately
§  (Don’t show the programmer the drawing, that
makes it too easy, we’re trying to simulate real
coding)
§  How long did it take? Will the customer be
happy?
Thanks to the members of the agile-games group and
Kane Mar for ideas & pictures for this game
Copyright 2012: Lisa Crispin
22
Ways to collaborate
Pair:
Tester-Coder
Tester-Tester
Any role – any role
Copyright 2012: Lisa Crispin
23
Team responsibility
Automate all regression tests
Copyright 2012: Lisa Crispin
24
Copyright 2012: Lisa Crispin
25
Learn
Experiment
Meaningful
Commitment
Copyright 2012: Lisa Crispin
Under-commit
Plan less work than you think you can do
Including all test automation
Copyright 2012: Lisa Crispin
27
Learn to write maintainable tests
§  Get over the “hump of pain”
From Gerard Meszaros’
XUnit Test Patterns
Whole-team software development
28
Create a
user
story
Write
Customer
(Q2)
Tests
Start
thinking
how to
code
Expand
tests –
Story
Tests
Automate
Q2 Tests
Exploratory
testing
TDD
Customer
User
Acceptance
Product owner
Product owner/ Tester
Tester
Tester/Programmer
Programmer
Pair,
“Show
Me”
Copyright 2012: Lisa Crispin
Exercise
• Think of an experiment to get your
whole team engaged in automating
tests
• Share with your group
Copyright 2012: Lisa Crispin
30
Getting Over the Hump
§  The test automation pyramid
§  The agile testing quadrants
§  What should be automated
§  What shouldn't
§  Difficult areas
Copyright 2012: Lisa Crispin
31
Test Automation Pyramid
Copyright 2012: Lisa Crispin
Test Automation Volcano
From Matt
Barcomb
Copyright 2012: Lisa Crispin
33
Agile Testing Quadrants
Copyright 2012: Lisa Crispin
34
Shared Understanding
§  Start with tests
§  Collaborate
Copyright 2012: Lisa Crispin
35
What Should We Automate?
§  Quadrant 1 tests
§  Unit, component, TDD
§  Quadrant 2 tests
§  API, service-level
§  Quadrant 4 tests
§  Load, performance, stress
§  Quadrant 3 tests?
§  Leverage automation where useful
Copyright 2012: Lisa Crispin
36
What Shouldn’t We Automate?
§  Quadrant 2 tests
§  Wizard of Oz, prototyping
§  Quadrant 3 tests
§  Usability, UAT, ET
§  Tests that will never fail?
§  Assess risk
§  ROI not enough
§  One-off tests
Copyright 2012: Lisa Crispin
37
Where Should We Be Careful?
§  GUI tests
§  Watch ROI
§  End-to-End tests
§  Push testing down to lowest level
§  Remember the Pyramid
Copyright 2012: Lisa Crispin
38
Hard to Automate?
§  Legacy code
§  Hard to automate, or just lack of skill?
§  “Working Effectively with Legacy Code” –
Feathers
§  “Strangling” – Fowler, Thomas
Copyright 2012: Lisa Crispin
39
Exercise: Low-Hanging Fruit
Copyright 2012: Lisa Crispin
40
Agile Automation Strategy
§  What hurts the most
§  Layered approach
§  Applying agile principles
§  Small chunks/thin slices
§  Smart test design
§  Choosing the right tools
Copyright 2012: Lisa Crispin
41
What Hurts the Most
§  Use retrospectives
§  Keep an impediment backlog
Copyright 2012: Lisa Crispin
42
Multi-Layered Approach
Example:
§  Learn TDD at unit level
§  Automate GUI smoke tests
Copyright 2012: Lisa Crispin
43
Simplicity
§  Make the biggest problem 20% better
§  Understand the problem first
§  Try simplest approach first
§  Work in small chunks, thin slices
§  Incremental & iterative
Copyright 2012: Lisa Crispin
44
Automate a Slice at a Time
Example: 4-step UI to validate, upload profit
sharing contribution data
•  Thread 1: All four pages with navigation
•  Thread 2: Select year, enter description on page
1, display on page 2, browse and upload file on
page 2
•  Thread 3: Validate data in file, display on page 3
•  Thread 4: Persist data, display ‘success’
message on page 4
Copyright 2012: Lisa Crispin
45
Thin Slice Example
Copyright 2012: Lisa Crispin
46
Exercise: Thin Slices
Here’s our user story:
As an internet shopper, I want to create an
account so that I do not have to enter my address
and billing information each time I make a
purchase
Draw a mind map for this feature on a big sheet of
paper
Identify a basic end-to-end slice of functionality
that can be coded, tested, and automated.
If you have time, identify additional slices.
47
Test Design Patterns/Principles
§  Patterns, eg, Page
Object
§  One clear purpose
§  Don’t Repeat Yourself
Copyright 2012: Lisa Crispin
48
Page Object Pattern
A “page object” is a test object that holds
the details of all the elements on a web
page that might be involved in an
automated test.
Copyright 2012: Lisa Crispin
49
Page Object Pattern
§  Test object holds all details of one page
§  Hide details and eliminate duplication
Go To ePS Admin Page
Click Link eps admin
Wait Until Page Contains plan administration
Location Should Be ${EPSADMIN URL}
Copyright 2012: Lisa Crispin
50
Facilitating Exploratory Testing
§  Templates to set up tests
§  Consoles to facilitate visual inspection
Copyright 2012: Lisa Crispin
51
Demo
Copyright 2012: Lisa Crispin
52
Iterative Feedback
§  Spike two different approaches
§  Pick one to try for N # of iterations
§  Use retrospectives to evaluate
Copyright 2012: Lisa Crispin
53
Learn by Doing
§  Courage – don’t be afraid to fail
§  Production code practices for test code
§  Incremental, thin slices
§  Experiment
Copyright 2012: Lisa Crispin
54
Questions About Automation Strategy?
Copyright 2012: Lisa Crispin
55
Choosing Tools
§  Team effort
§  Time
§  Requirements
§  Focus on goals, problems, not tools.
§  Experiment
Copyright 2012: Lisa Crispin
56
Understand the Purpose
§  Who’s using the tests? What for?
§  What’s being automated?
§  Existing tools, environment
§  Who’s doing what for automating?
Copyright 2012: Lisa Crispin
57
What Fits Your Situation
•  Existing skills
•  Language of application under test
•  Collaboration needs
•  What’s being automated
•  Life span, future use of tests
Copyright 2012: Lisa Crispin
58
Test Drivers/Frameworks
§  Divide into sub-teams and prototype
solutions
§  Have a “bake-off” showing each prototype
Copyright 2012: Lisa Crispin
59
Where To Find Tools
§  http://bit.ly/AgileTestTools
§  www.softwareqatest.com/qattls1.html
§  www.testingfaqs.org
§  www.opensourcetesting.org
§  groups.yahoo.com/group/agile-testing
§  Grow your own!
Copyright 2012: Lisa Crispin
60
Example: One Team’s Tool Choices
•  IntelliJ Idea
•  Jenkins, ant, Maven
•  JUnit
•  FitNesse
•  Canoo WebTest
•  Watir
•  Robot Framework
•  JMeter
•  Selenium 2.0 / WebDriver with Geb framework
Copyright 2012: Lisa Crispin
61
Exercise: Test Frameworks
•  What format might work for your team’s
tests?
•  Write examples on sticky notes
•  What patterns, frameworks and drivers do
you want to learn more about?
•  Place sticky notes next to impediment
they might help overcome
•  Discuss how this would help solve
problem
Copyright 2012: Lisa Crispin
62
Making Test Automation Work
§  Time to do it right
§  Experiments, bake-offs
§  Testable architecture
§  Test data
§  Managing tests
Copyright 2012: Lisa Crispin
63
Time To Do It Right
§  Limit scope, don’t over-commit
§  Write automation task cards
§  Quality must be team goal
§  Long-term, will let you go faster
Copyright 2012: Lisa Crispin
64
Bake-offs
§  Sub-teams/pairs experiment
§  Time box
§  Pros & cons
Copyright 2012: Lisa Crispin
65
Testable Architecture
•  Layered architecture
•  eg. UI, business logic, data access
•  Ports and Adapters pattern
•  App can work without UI or database
•  Ports accept outside events
•  Adapters convert for human or automated
users
Copyright 2012: Lisa Crispin
66
Test Data
§  Avoid database access when possible
§  Setup/Teardown
§  Independent, rerunnable tests
§  Canonical data
§  Refresh before each test run
§  Customizable data for ET
§  Production-like data
§  Get customers to provide example data
Copyright 2012: Lisa Crispin
67
Managing Automated Tests
§  Tests as Living Documentation
§  Continuous Integration
§  Reporting results
§  Metrics
Copyright 2012: Lisa Crispin
68
Tests as Living Documentation
§  Understandable
§  Who will really use them?
§  Once passing, must always pass
Copyright 2012: Lisa Crispin
69
Any Example Can Become a Test
Copyright 2012: Lisa Crispin
70
Given/Then/When Example
Scenario: Valid name search returns results
GIVEN that Kant is a supervisor with employees
AND Kant has an employee named Smith
WHEN Kant navigates to the employee name
search page
AND enters the value “S”
THEN Kant will see a search result that includes
Smith
Copyright 2012: Lisa Crispin
71
Continuous integration/testing…
…short feedback loop
Copyright 2012: Lisa Crispin
72
Keep tests passing
Stop the line to fix problems
Copyright 2012: Lisa Crispin
73
Test Management Tools
§  Manage tests, code together
§  Some tools have own management
§  What problem are you trying to solve?
Copyright 2012: Lisa Crispin
74
Exercise: Tests as Documentation
•  Pair up
•  Walk around the room and talk about
what approach may work for your
team
•  BDD?
•  Tabular style?
•  Examples?
•  Something else?
•  How will people in different roles
use them?
75
Key Success Factors
Whole Team
Approach

Thin Slices

Short
Feedback
Loops

Experiments

Specification
by Example
Copyright 2012: Lisa Crispin
76
Exercise: Breaking Barriers
Copyright 2012: Lisa Crispin
77
Remember
§  It’s a team problem!
§  Tackle automation problems with diversity
§  Try small experiments
§  Start the test automation rebellion with baby
steps
Copyright 2012: Lisa Crispin
78
Questions? “Aha” Moments?
Copyright 2012: Lisa Crispin
79
Agile Testing: A Practical Guide for Testers and Agile
Teams
By Lisa Crispin and Janet Gregory
www.agiletester.ca
Copyright 2012: Lisa Crispin
80
Experiences of Test Automation
Dorothy Graham and Mark Fewster
Copyright 2012: Lisa Crispin
81
Beautiful Testing: Leading Professionals Reveal How
They Improve Software
Edited by Tim Riley, Adam Goucher
Includes chapter by yours truly
Copyright 2012: Lisa Crispin
82
Test Patterns
Xunit Test Patterns: Refactoring Test Code
By Gerard Meszaros
Copyright 2012: Lisa Crispin
Copyright 2008 Janet Gregory, DragonFire
83
Specification by Example
How successful teams deliver the right
software
Gojko Adzic
Case studies from > 50 teams
Copyright 2012: Lisa Crispin
Copyright 2008 Janet Gregory, DragonFire
84
ATDD by Example
A practical guide to Acceptance Test-Driven
development
Markus Gaertner
Copyright 2012: Lisa Crispin
85
Agile Test Automation Resources
§ dhemery.com/pdf/
writing_maintainable_automated_acceptance_tests.pdf
§ lisacrispin.com
§ janetgregory.ca
§ gokjo.net
§ exampler.com
§ agile-testing@yahoogroups.com
§ testobsessed.com
§ testingreflections.com
§ www.beer30.org

More Related Content

What's hot

Whole Team Approach to Testing, Illustrated
Whole Team Approach to Testing, IllustratedWhole Team Approach to Testing, Illustrated
Whole Team Approach to Testing, Illustrated
lisacrispin
 
Agile testing myths v5 final-
Agile testing myths v5 final-Agile testing myths v5 final-
Agile testing myths v5 final-
lisacrispin
 
Testing in a Continuous World
Testing in a Continuous WorldTesting in a Continuous World
Testing in a Continuous World
Lisi Hocke
 

What's hot (20)

Belgium Testing Days - Making Test Automation Work in Agile Projects
Belgium Testing Days - Making Test Automation Work in Agile ProjectsBelgium Testing Days - Making Test Automation Work in Agile Projects
Belgium Testing Days - Making Test Automation Work in Agile Projects
 
Minding your own business - TestBash 2 talk
Minding your own business - TestBash 2 talkMinding your own business - TestBash 2 talk
Minding your own business - TestBash 2 talk
 
Do testers have to code... to be useful?
Do testers have to code... to be useful?Do testers have to code... to be useful?
Do testers have to code... to be useful?
 
Whole Team Approach to Testing, Illustrated
Whole Team Approach to Testing, IllustratedWhole Team Approach to Testing, Illustrated
Whole Team Approach to Testing, Illustrated
 
Agile testing myths v5 final-
Agile testing myths v5 final-Agile testing myths v5 final-
Agile testing myths v5 final-
 
Mob Programming and the Power of Flow by Woody Zuill at #AgileIndia2019
Mob Programming and the Power of Flow by Woody Zuill at #AgileIndia2019Mob Programming and the Power of Flow by Woody Zuill at #AgileIndia2019
Mob Programming and the Power of Flow by Woody Zuill at #AgileIndia2019
 
Retrospective Anti-Patterns by Aino Corry at #AgileIndia2019
Retrospective Anti-Patterns by Aino Corry at #AgileIndia2019Retrospective Anti-Patterns by Aino Corry at #AgileIndia2019
Retrospective Anti-Patterns by Aino Corry at #AgileIndia2019
 
Using your testing mindset to explore requirements
Using your testing mindset to explore requirementsUsing your testing mindset to explore requirements
Using your testing mindset to explore requirements
 
Testing is a team problem
Testing is a team problemTesting is a team problem
Testing is a team problem
 
Montreal alm-20150509-benday-good-to-great-scrum-master
Montreal alm-20150509-benday-good-to-great-scrum-masterMontreal alm-20150509-benday-good-to-great-scrum-master
Montreal alm-20150509-benday-good-to-great-scrum-master
 
Inception deck and lift off examples
Inception deck and lift off   examplesInception deck and lift off   examples
Inception deck and lift off examples
 
Agile Testing in the Enterprise
Agile Testing in the Enterprise Agile Testing in the Enterprise
Agile Testing in the Enterprise
 
Stop punching yourself in the face!
Stop punching yourself in the face!Stop punching yourself in the face!
Stop punching yourself in the face!
 
Agile is Dead :: Viana Tech Meetups 2018
Agile is Dead :: Viana Tech Meetups 2018Agile is Dead :: Viana Tech Meetups 2018
Agile is Dead :: Viana Tech Meetups 2018
 
Agile is Dead :: Agile Connect Lisbon 2018
Agile is Dead :: Agile Connect Lisbon 2018 Agile is Dead :: Agile Connect Lisbon 2018
Agile is Dead :: Agile Connect Lisbon 2018
 
Agile is Dead :: Aginext London 2018
Agile is Dead :: Aginext London 2018Agile is Dead :: Aginext London 2018
Agile is Dead :: Aginext London 2018
 
Intro to Agile Practices and Values
Intro to Agile Practices and ValuesIntro to Agile Practices and Values
Intro to Agile Practices and Values
 
Launching agile projects template pack
Launching agile projects   template packLaunching agile projects   template pack
Launching agile projects template pack
 
Agile Testing in the Enterprise 2016
Agile Testing in the Enterprise   2016Agile Testing in the Enterprise   2016
Agile Testing in the Enterprise 2016
 
Testing in a Continuous World
Testing in a Continuous WorldTesting in a Continuous World
Testing in a Continuous World
 

Similar to Making Test Automation Work in Agile Projects 2012

Atd agile automation
Atd agile automationAtd agile automation
Atd agile automation
lisacrispin
 
AgileTestingOverview
AgileTestingOverviewAgileTestingOverview
AgileTestingOverview
Umair Anis
 
What Testers Can Learn to Collaborate Effectively with Programmers, others
What Testers Can Learn to Collaborate Effectively with Programmers, othersWhat Testers Can Learn to Collaborate Effectively with Programmers, others
What Testers Can Learn to Collaborate Effectively with Programmers, others
lisacrispin
 
Add usability testing to your skill set!
Add usability testing to your skill set!Add usability testing to your skill set!
Add usability testing to your skill set!
dcmistry
 
Atd advanced topicsworkshop
Atd advanced topicsworkshopAtd advanced topicsworkshop
Atd advanced topicsworkshop
lisacrispin
 
Using agile testing to drive product innovation
Using agile testing to drive product innovationUsing agile testing to drive product innovation
Using agile testing to drive product innovation
Stephen Graves
 

Similar to Making Test Automation Work in Agile Projects 2012 (20)

Atd agile automation
Atd agile automationAtd agile automation
Atd agile automation
 
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012
The Whole Team Approach, Illustrated. Keynote from Turku Agile Days 2012
 
What testers can learn to work more effectively with programmers
What testers can learn to work more effectively with programmersWhat testers can learn to work more effectively with programmers
What testers can learn to work more effectively with programmers
 
AgileTestingOverview
AgileTestingOverviewAgileTestingOverview
AgileTestingOverview
 
What Testers Can Learn to Collaborate Effectively with Programmers, others
What Testers Can Learn to Collaborate Effectively with Programmers, othersWhat Testers Can Learn to Collaborate Effectively with Programmers, others
What Testers Can Learn to Collaborate Effectively with Programmers, others
 
Add usability testing to your skill set!
Add usability testing to your skill set!Add usability testing to your skill set!
Add usability testing to your skill set!
 
Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013
Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013
Emily Bache - Readable, Executable Requirements: Hands-On - EuroSTAR 2013
 
Atd advanced topicsworkshop
Atd advanced topicsworkshopAtd advanced topicsworkshop
Atd advanced topicsworkshop
 
[DSC Croatia 22] How we create and leverage data services in GitLab - Radovan...
[DSC Croatia 22] How we create and leverage data services in GitLab - Radovan...[DSC Croatia 22] How we create and leverage data services in GitLab - Radovan...
[DSC Croatia 22] How we create and leverage data services in GitLab - Radovan...
 
Global Day of Coderetreat Munich 2017
Global Day of Coderetreat Munich 2017Global Day of Coderetreat Munich 2017
Global Day of Coderetreat Munich 2017
 
Amanda Cinnamon - Treat Your Code Like the Valuable Software It Is
Amanda Cinnamon - Treat Your Code Like the Valuable Software It IsAmanda Cinnamon - Treat Your Code Like the Valuable Software It Is
Amanda Cinnamon - Treat Your Code Like the Valuable Software It Is
 
Using agile testing to drive product innovation
Using agile testing to drive product innovationUsing agile testing to drive product innovation
Using agile testing to drive product innovation
 
Tools & Preparations
Tools & PreparationsTools & Preparations
Tools & Preparations
 
The future of testing magento 2 james cowie from shero commerce - 10 24-20 ...
The future of testing magento 2   james cowie from shero commerce - 10 24-20 ...The future of testing magento 2   james cowie from shero commerce - 10 24-20 ...
The future of testing magento 2 james cowie from shero commerce - 10 24-20 ...
 
Global Day of Coderetreat Munich 2018
Global Day of Coderetreat Munich 2018Global Day of Coderetreat Munich 2018
Global Day of Coderetreat Munich 2018
 
Strategies to Manage Conflict in the Virtual Workplace
Strategies to Manage Conflict in the Virtual WorkplaceStrategies to Manage Conflict in the Virtual Workplace
Strategies to Manage Conflict in the Virtual Workplace
 
xAPI Geek Free - Learning DevCamp 2018
xAPI Geek Free - Learning DevCamp 2018xAPI Geek Free - Learning DevCamp 2018
xAPI Geek Free - Learning DevCamp 2018
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile Environment
 
Agile Practices
Agile PracticesAgile Practices
Agile Practices
 
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”GlobalLogic QA Webinar “What does it take to become a Test Engineer”
GlobalLogic QA Webinar “What does it take to become a Test Engineer”
 

More from lisacrispin

SQuAD 2013: Team Collaboration for Testing
SQuAD 2013: Team Collaboration for TestingSQuAD 2013: Team Collaboration for Testing
SQuAD 2013: Team Collaboration for Testing
lisacrispin
 

More from lisacrispin (16)

Exploring Requirements for Shared Understanding
Exploring Requirements for Shared UnderstandingExploring Requirements for Shared Understanding
Exploring Requirements for Shared Understanding
 
Principles for Agile Testers and Modern Testing Principles
Principles for Agile Testers and Modern Testing PrinciplesPrinciples for Agile Testers and Modern Testing Principles
Principles for Agile Testers and Modern Testing Principles
 
BDD and CD - better together
BDD and CD - better togetherBDD and CD - better together
BDD and CD - better together
 
Get testing bottlenecks out of your pipelines
Get testing bottlenecks out of your pipelinesGet testing bottlenecks out of your pipelines
Get testing bottlenecks out of your pipelines
 
Thinking Outside the Box: Cognitive bias and testing
Thinking Outside the Box: Cognitive bias and testingThinking Outside the Box: Cognitive bias and testing
Thinking Outside the Box: Cognitive bias and testing
 
The Whole Team Approach to Quality in Continuous Delivery
The Whole Team Approach to Quality in Continuous DeliveryThe Whole Team Approach to Quality in Continuous Delivery
The Whole Team Approach to Quality in Continuous Delivery
 
DeliveryConf - Whole Team Approach to Testing in Continuous Delivery
DeliveryConf - Whole Team Approach to Testing in Continuous DeliveryDeliveryConf - Whole Team Approach to Testing in Continuous Delivery
DeliveryConf - Whole Team Approach to Testing in Continuous Delivery
 
ALN Houston - "Build Quality In: Guiding Development with Tests"
ALN Houston - "Build Quality In: Guiding Development with Tests"ALN Houston - "Build Quality In: Guiding Development with Tests"
ALN Houston - "Build Quality In: Guiding Development with Tests"
 
Agile 20015 Boot Camp: Intro to Agile Testing - Everyone Owns Quality
Agile 20015 Boot Camp: Intro to Agile Testing - Everyone Owns QualityAgile 20015 Boot Camp: Intro to Agile Testing - Everyone Owns Quality
Agile 20015 Boot Camp: Intro to Agile Testing - Everyone Owns Quality
 
Morph your mindset for Continuous Delivery, Agile Roots 2014
Morph your mindset for Continuous Delivery,  Agile Roots 2014Morph your mindset for Continuous Delivery,  Agile Roots 2014
Morph your mindset for Continuous Delivery, Agile Roots 2014
 
Belgium Testing Days: Shift your testing mindset
Belgium Testing Days: Shift your testing mindsetBelgium Testing Days: Shift your testing mindset
Belgium Testing Days: Shift your testing mindset
 
Changing Your Testing Mindset, Booster Conference, Bergen, Norway, 2014
Changing Your Testing Mindset, Booster Conference, Bergen, Norway, 2014Changing Your Testing Mindset, Booster Conference, Bergen, Norway, 2014
Changing Your Testing Mindset, Booster Conference, Bergen, Norway, 2014
 
Developers who grok testing: why I love them and how they mitigate risk
Developers who grok testing: why I love them and how they mitigate riskDevelopers who grok testing: why I love them and how they mitigate risk
Developers who grok testing: why I love them and how they mitigate risk
 
Code mashadvancedtopicsworkshop
Code mashadvancedtopicsworkshopCode mashadvancedtopicsworkshop
Code mashadvancedtopicsworkshop
 
SQuAD 2013: Team Collaboration for Testing
SQuAD 2013: Team Collaboration for TestingSQuAD 2013: Team Collaboration for Testing
SQuAD 2013: Team Collaboration for Testing
 
Oredev pairing
Oredev pairingOredev pairing
Oredev pairing
 

Recently uploaded

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 

Making Test Automation Work in Agile Projects 2012

  • 1. 1 Making Test Automation Work in Agile Projects ØREDEV 2012 Lisa Crispin With Material from Janet Gregory
  • 2. 2 Introductions: Experience, Goals §  Form groups: §  New to automation §  One to two years experience w/ automation §  More than two years experience §  Talk with at least two other people §  Tell each other your learning goals for today §  Note the most interesting one you hear
  • 3. Copyright 2012: Lisa Crispin 3 About me… Programmer, tester, agile team member
  • 4. Copyright 2012: Lisa Crispin 4 Introduction - You
  • 5. Copyright 2012: Lisa Crispin 5 Vive la Rebellion! Successful test automation is an innovation! •  Let go of traditional roles, reach across them •  Visualize how tests should look •  Be smart about when to automate •  Experiment to overcome obstacles •  Find/build the right tools
  • 6. 6 Exercise: Your Learning Goals §  Write one interesting learning goal you heard from another participant at the start of the class on a sticky note. §  Write your number one learning goal for today on a sticky note. §  Put the sticky notes on your “learning goals” sheet §  Group similar ones together
  • 7. Copyright 2012: Lisa Crispin 7 Let’s start by defining “agile” Agile teams: q  Deliver business value frequently q  at a sustainable pace q  while adapting to the changing needs of the business Source: Elisabeth Hendrickson
  • 8. Copyright 2012: Lisa Crispin 8 The key is “sustainable pace” Technical debt slows us down
  • 9. Copyright 2012: Lisa Crispin High technical debt + insufficient automation = even less time
  • 10. Copyright 2012: Lisa Crispin 10 Barriers to Test Automation What’s holding you back?
  • 11. Copyright 2012: Lisa Crispin 11 Exercise: Your barriers Individually and silently – write one barrier hindering your team per sticky note Put these on the “impediments” wall chart for your table group Talk to your fellow group members – do you see any patterns?
  • 12. Copyright 2012: Lisa Crispin 12 Questions?
  • 13. Copyright 2012: Lisa Crispin 13 The Whole-Team Approach §  Automated tests are code §  Respecting the tests §  Collaborating §  Commitment to quality §  Return on investment
  • 14. Copyright 2012: Lisa Crispin 14 Automated tests are code public class CalculatorFixture extends ColumnFixture { public String startDate; public String endDate; public double startBalance; public double endBalance; public String irrTarget; private Calculator calculator = new Calculator(); private Double irr;
  • 15. Source: Gojko Adzic, StarEast 2011 keynote
  • 16. Source: Gojko Adzic, StarEast 2011 keynote
  • 17. Copyright 2012: Lisa Crispin 17 Testers are especially good at… § Eliciting examples § Turning them into tests § Ensuring the right testing gets done § Exploratory testing
  • 18. 18 Give testers time to do what we do best How?
  • 20. Copyright 2012: Lisa Crispin 20 Experiment: Iteration 1 §  Pair up: one will be tester, one programmer §  Sit back to back so you face away from each other §  Tester gets a drawing which needs to be replicated §  Tester tells the programmer what to draw, all at one time. §  Programmer draws the shapes based on what the tester explained. §  No talking during ‘coding’! §  Tester “tests” the drawing, reports “bugs” on index cards §  Programmer fixes the “bugs” §  How long did it take? Will the customer be happy?
  • 21. Copyright 2012: Lisa Crispin 21 Experiment: Iteration 2 §  Collaborate! §  Tester tells programmer what to draw, watches the programmer draw, answers questions, points out ‘defects’ for programmer to fix immediately §  (Don’t show the programmer the drawing, that makes it too easy, we’re trying to simulate real coding) §  How long did it take? Will the customer be happy? Thanks to the members of the agile-games group and Kane Mar for ideas & pictures for this game
  • 22. Copyright 2012: Lisa Crispin 22 Ways to collaborate Pair: Tester-Coder Tester-Tester Any role – any role
  • 23. Copyright 2012: Lisa Crispin 23 Team responsibility Automate all regression tests
  • 24. Copyright 2012: Lisa Crispin 24
  • 25. Copyright 2012: Lisa Crispin 25 Learn Experiment Meaningful Commitment
  • 26. Copyright 2012: Lisa Crispin Under-commit Plan less work than you think you can do Including all test automation
  • 27. Copyright 2012: Lisa Crispin 27 Learn to write maintainable tests §  Get over the “hump of pain” From Gerard Meszaros’ XUnit Test Patterns
  • 28. Whole-team software development 28 Create a user story Write Customer (Q2) Tests Start thinking how to code Expand tests – Story Tests Automate Q2 Tests Exploratory testing TDD Customer User Acceptance Product owner Product owner/ Tester Tester Tester/Programmer Programmer Pair, “Show Me”
  • 29. Copyright 2012: Lisa Crispin Exercise • Think of an experiment to get your whole team engaged in automating tests • Share with your group
  • 30. Copyright 2012: Lisa Crispin 30 Getting Over the Hump §  The test automation pyramid §  The agile testing quadrants §  What should be automated §  What shouldn't §  Difficult areas
  • 31. Copyright 2012: Lisa Crispin 31 Test Automation Pyramid
  • 32. Copyright 2012: Lisa Crispin Test Automation Volcano From Matt Barcomb
  • 33. Copyright 2012: Lisa Crispin 33 Agile Testing Quadrants
  • 34. Copyright 2012: Lisa Crispin 34 Shared Understanding §  Start with tests §  Collaborate
  • 35. Copyright 2012: Lisa Crispin 35 What Should We Automate? §  Quadrant 1 tests §  Unit, component, TDD §  Quadrant 2 tests §  API, service-level §  Quadrant 4 tests §  Load, performance, stress §  Quadrant 3 tests? §  Leverage automation where useful
  • 36. Copyright 2012: Lisa Crispin 36 What Shouldn’t We Automate? §  Quadrant 2 tests §  Wizard of Oz, prototyping §  Quadrant 3 tests §  Usability, UAT, ET §  Tests that will never fail? §  Assess risk §  ROI not enough §  One-off tests
  • 37. Copyright 2012: Lisa Crispin 37 Where Should We Be Careful? §  GUI tests §  Watch ROI §  End-to-End tests §  Push testing down to lowest level §  Remember the Pyramid
  • 38. Copyright 2012: Lisa Crispin 38 Hard to Automate? §  Legacy code §  Hard to automate, or just lack of skill? §  “Working Effectively with Legacy Code” – Feathers §  “Strangling” – Fowler, Thomas
  • 39. Copyright 2012: Lisa Crispin 39 Exercise: Low-Hanging Fruit
  • 40. Copyright 2012: Lisa Crispin 40 Agile Automation Strategy §  What hurts the most §  Layered approach §  Applying agile principles §  Small chunks/thin slices §  Smart test design §  Choosing the right tools
  • 41. Copyright 2012: Lisa Crispin 41 What Hurts the Most §  Use retrospectives §  Keep an impediment backlog
  • 42. Copyright 2012: Lisa Crispin 42 Multi-Layered Approach Example: §  Learn TDD at unit level §  Automate GUI smoke tests
  • 43. Copyright 2012: Lisa Crispin 43 Simplicity §  Make the biggest problem 20% better §  Understand the problem first §  Try simplest approach first §  Work in small chunks, thin slices §  Incremental & iterative
  • 44. Copyright 2012: Lisa Crispin 44 Automate a Slice at a Time Example: 4-step UI to validate, upload profit sharing contribution data •  Thread 1: All four pages with navigation •  Thread 2: Select year, enter description on page 1, display on page 2, browse and upload file on page 2 •  Thread 3: Validate data in file, display on page 3 •  Thread 4: Persist data, display ‘success’ message on page 4
  • 45. Copyright 2012: Lisa Crispin 45 Thin Slice Example
  • 46. Copyright 2012: Lisa Crispin 46 Exercise: Thin Slices Here’s our user story: As an internet shopper, I want to create an account so that I do not have to enter my address and billing information each time I make a purchase Draw a mind map for this feature on a big sheet of paper Identify a basic end-to-end slice of functionality that can be coded, tested, and automated. If you have time, identify additional slices.
  • 47. 47 Test Design Patterns/Principles §  Patterns, eg, Page Object §  One clear purpose §  Don’t Repeat Yourself
  • 48. Copyright 2012: Lisa Crispin 48 Page Object Pattern A “page object” is a test object that holds the details of all the elements on a web page that might be involved in an automated test.
  • 49. Copyright 2012: Lisa Crispin 49 Page Object Pattern §  Test object holds all details of one page §  Hide details and eliminate duplication Go To ePS Admin Page Click Link eps admin Wait Until Page Contains plan administration Location Should Be ${EPSADMIN URL}
  • 50. Copyright 2012: Lisa Crispin 50 Facilitating Exploratory Testing §  Templates to set up tests §  Consoles to facilitate visual inspection
  • 51. Copyright 2012: Lisa Crispin 51 Demo
  • 52. Copyright 2012: Lisa Crispin 52 Iterative Feedback §  Spike two different approaches §  Pick one to try for N # of iterations §  Use retrospectives to evaluate
  • 53. Copyright 2012: Lisa Crispin 53 Learn by Doing §  Courage – don’t be afraid to fail §  Production code practices for test code §  Incremental, thin slices §  Experiment
  • 54. Copyright 2012: Lisa Crispin 54 Questions About Automation Strategy?
  • 55. Copyright 2012: Lisa Crispin 55 Choosing Tools §  Team effort §  Time §  Requirements §  Focus on goals, problems, not tools. §  Experiment
  • 56. Copyright 2012: Lisa Crispin 56 Understand the Purpose §  Who’s using the tests? What for? §  What’s being automated? §  Existing tools, environment §  Who’s doing what for automating?
  • 57. Copyright 2012: Lisa Crispin 57 What Fits Your Situation •  Existing skills •  Language of application under test •  Collaboration needs •  What’s being automated •  Life span, future use of tests
  • 58. Copyright 2012: Lisa Crispin 58 Test Drivers/Frameworks §  Divide into sub-teams and prototype solutions §  Have a “bake-off” showing each prototype
  • 59. Copyright 2012: Lisa Crispin 59 Where To Find Tools §  http://bit.ly/AgileTestTools §  www.softwareqatest.com/qattls1.html §  www.testingfaqs.org §  www.opensourcetesting.org §  groups.yahoo.com/group/agile-testing §  Grow your own!
  • 60. Copyright 2012: Lisa Crispin 60 Example: One Team’s Tool Choices •  IntelliJ Idea •  Jenkins, ant, Maven •  JUnit •  FitNesse •  Canoo WebTest •  Watir •  Robot Framework •  JMeter •  Selenium 2.0 / WebDriver with Geb framework
  • 61. Copyright 2012: Lisa Crispin 61 Exercise: Test Frameworks •  What format might work for your team’s tests? •  Write examples on sticky notes •  What patterns, frameworks and drivers do you want to learn more about? •  Place sticky notes next to impediment they might help overcome •  Discuss how this would help solve problem
  • 62. Copyright 2012: Lisa Crispin 62 Making Test Automation Work §  Time to do it right §  Experiments, bake-offs §  Testable architecture §  Test data §  Managing tests
  • 63. Copyright 2012: Lisa Crispin 63 Time To Do It Right §  Limit scope, don’t over-commit §  Write automation task cards §  Quality must be team goal §  Long-term, will let you go faster
  • 64. Copyright 2012: Lisa Crispin 64 Bake-offs §  Sub-teams/pairs experiment §  Time box §  Pros & cons
  • 65. Copyright 2012: Lisa Crispin 65 Testable Architecture •  Layered architecture •  eg. UI, business logic, data access •  Ports and Adapters pattern •  App can work without UI or database •  Ports accept outside events •  Adapters convert for human or automated users
  • 66. Copyright 2012: Lisa Crispin 66 Test Data §  Avoid database access when possible §  Setup/Teardown §  Independent, rerunnable tests §  Canonical data §  Refresh before each test run §  Customizable data for ET §  Production-like data §  Get customers to provide example data
  • 67. Copyright 2012: Lisa Crispin 67 Managing Automated Tests §  Tests as Living Documentation §  Continuous Integration §  Reporting results §  Metrics
  • 68. Copyright 2012: Lisa Crispin 68 Tests as Living Documentation §  Understandable §  Who will really use them? §  Once passing, must always pass
  • 69. Copyright 2012: Lisa Crispin 69 Any Example Can Become a Test
  • 70. Copyright 2012: Lisa Crispin 70 Given/Then/When Example Scenario: Valid name search returns results GIVEN that Kant is a supervisor with employees AND Kant has an employee named Smith WHEN Kant navigates to the employee name search page AND enters the value “S” THEN Kant will see a search result that includes Smith
  • 71. Copyright 2012: Lisa Crispin 71 Continuous integration/testing… …short feedback loop
  • 72. Copyright 2012: Lisa Crispin 72 Keep tests passing Stop the line to fix problems
  • 73. Copyright 2012: Lisa Crispin 73 Test Management Tools §  Manage tests, code together §  Some tools have own management §  What problem are you trying to solve?
  • 74. Copyright 2012: Lisa Crispin 74 Exercise: Tests as Documentation •  Pair up •  Walk around the room and talk about what approach may work for your team •  BDD? •  Tabular style? •  Examples? •  Something else? •  How will people in different roles use them?
  • 75. 75 Key Success Factors Whole Team Approach Thin Slices Short Feedback Loops Experiments Specification by Example
  • 76. Copyright 2012: Lisa Crispin 76 Exercise: Breaking Barriers
  • 77. Copyright 2012: Lisa Crispin 77 Remember §  It’s a team problem! §  Tackle automation problems with diversity §  Try small experiments §  Start the test automation rebellion with baby steps
  • 78. Copyright 2012: Lisa Crispin 78 Questions? “Aha” Moments?
  • 79. Copyright 2012: Lisa Crispin 79 Agile Testing: A Practical Guide for Testers and Agile Teams By Lisa Crispin and Janet Gregory www.agiletester.ca
  • 80. Copyright 2012: Lisa Crispin 80 Experiences of Test Automation Dorothy Graham and Mark Fewster
  • 81. Copyright 2012: Lisa Crispin 81 Beautiful Testing: Leading Professionals Reveal How They Improve Software Edited by Tim Riley, Adam Goucher Includes chapter by yours truly
  • 82. Copyright 2012: Lisa Crispin 82 Test Patterns Xunit Test Patterns: Refactoring Test Code By Gerard Meszaros
  • 83. Copyright 2012: Lisa Crispin Copyright 2008 Janet Gregory, DragonFire 83 Specification by Example How successful teams deliver the right software Gojko Adzic Case studies from > 50 teams
  • 84. Copyright 2012: Lisa Crispin Copyright 2008 Janet Gregory, DragonFire 84 ATDD by Example A practical guide to Acceptance Test-Driven development Markus Gaertner
  • 85. Copyright 2012: Lisa Crispin 85 Agile Test Automation Resources § dhemery.com/pdf/ writing_maintainable_automated_acceptance_tests.pdf § lisacrispin.com § janetgregory.ca § gokjo.net § exampler.com § agile-testing@yahoogroups.com § testobsessed.com § testingreflections.com § www.beer30.org