SlideShare ist ein Scribd-Unternehmen logo
1 von 85
Downloaden Sie, um offline zu lesen
Making Test
Automation Work in
  Agile Projects

 Agile Testing Days 2012
          Lisa Crispin
 With Material from Janet Gregory


                                    1
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




                                                  2
About me…
Programmer, tester, agile team member
  Ever-evolving views on automation




                                                 3
                  Copyright 2012: Lisa Crispin
Introduction - You




                                               4
                Copyright 2012: Lisa Crispin
Takeaways
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
We won’t do any hands-on automation, but will demo
 some examples




                                                   5
                    Copyright 2012: Lisa Crispin
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 table group
    “learning goals” sheet
§  Group similar ones together



                                               6
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


                                                       7
                        Copyright 2012: Lisa Crispin
The key is “sustainable pace”

Technical debt slows us down




                                                8
                 Copyright 2012: Lisa Crispin
The Death
Spiral
High technical debt +
insufficient automation =
even less time
          Copyright 2012: Lisa Crispin
Barriers to Test Automation
What’s holding you back?




                                               11
                Copyright 2012: Lisa Crispin
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
Work with your group to identify patterns,
  group similar items




                                                 12
                  Copyright 2012: Lisa Crispin
Questions?




                                            13
             Copyright 2012: Lisa Crispin
The Whole-Team Approach
§    Automated tests are code
§    Respecting the tests
§    Collaborating
§    Commitment to quality
§    Return on investment




                                                   14
                    Copyright 2012: Lisa Crispin
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
                 Copyright 2012: Lisa Crispin
Source: Gojko Adzic, StarEast 2011 keynote
Source: Gojko Adzic, StarEast 2011 keynote
Testers are especially good at…
§ Eliciting examples
§ Turning them into tests
§ Ensuring the right testing gets done
§ Exploratory testing




                                                   18
                    Copyright 2012: Lisa Crispin
Give testers time to do what we do best




                       How?
                                      19
20

The Whole-Team Approach
Experiment: Iteration 1
§  Pair up: one will be tester, one programmer
§  Sit back to back so you face away from each other
§  Tester: You have a drawing which you need to
    instruct your developer to draw
§  Programmer: Remain silent while working, only do
    what you’re instructed.
     §  No talking!
     §  No peeking!
When “done”:
§  Programmer – pass your drawing to the tester
§  Tester – note problems on separate card/paperWill
    the customer be happy?
                                                     21
                      Copyright 2012: Lisa Crispin
Experiment: Iteration 2
§    Now, turn to face each other.
§    Tester:
       §  Still don’t show your picture!
       §  Tell the programmer what to draw, but -
       §  Watch what the programmer draws, and point
           out any mistakes immediately
§    Programmer:
       §  Still no peeking!
       §  Ask questions, ask for feedback, make
           corrections immediately
      Thanks to the members of the agile-games group and
      Kane Mar for ideas & pictures for this game
                                                           22
                           Copyright 2012: Lisa Crispin
Ways to collaborate



                           Pair:
                           Tester-Coder
                           Tester-Tester
                           Any role – any role



                                                 23
               Copyright 2012: Lisa Crispin
Team responsibility
Automate all regression tests




                                              24
               Copyright 2012: Lisa Crispin
25
Copyright 2012: Lisa Crispin
Commitment to quality
What’s your team’s commitment?
The best possible software product?




                                                 26
                  Copyright 2012: Lisa Crispin
Meaningful
Commitment



                                            Experiment




                                            Learn
                                                    27
             Copyright 2012: Lisa Crispin
Under-commit

Plan less work than you think you can do
Including all test automation




                Copyright 2012: Lisa Crispin
Learn to write maintainable tests
§    Get over the “hump of pain”
                                      From Gerard Meszaros’
                                      XUnit Test Patterns




                                                              29
                     Copyright 2012: Lisa Crispin
Whole-team software development
Create a       Expand
  user         tests –
 story          Story
                Tests
                           Automate
  Write                    Q2 Tests       Pair,
Customer         Start                   “Show
  (Q2)         thinking                   Me”
 Tests          how to
                 code
                             TDD

                                      Exploratory
                                        testing
   Product owner
   Product owner/ Tester
   Tester
   Tester/Programmer
   Programmer                          Customer
                                         User
                                      Acceptance

                                                    30
Exercise

 • Think of an experiment to get your
 whole team engaged in automating
 tests
 • Share with your table group
 • Pick two to share with the class




               Copyright 2012: Lisa Crispin
Getting Over the Hump
§    The test automation pyramid
§    The agile testing quadrants
§    What should be automated
§    What shouldn't
§    Difficult areas




                                                   32
                    Copyright 2012: Lisa Crispin
Test Automation Pyramid




                                             33
              Copyright 2012: Lisa Crispin
Test Automation Volcano


From Matt
Barcomb




            Copyright 2012: Lisa Crispin
Agile Testing Quadrants




                                              35
               Copyright 2012: Lisa Crispin
Shared Understanding
§  Start with tests
§  Collaborate




                                                      36
                       Copyright 2012: Lisa Crispin
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




                                                   37
                    Copyright 2012: Lisa Crispin
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




                                                     38
                      Copyright 2012: Lisa Crispin
Where Should We Be Careful?
§  GUI tests
     §  Watch ROI
§  End-to-End tests
     §  Push testing down to lowest level
§  Remember the Pyramid




                                                    39
                     Copyright 2012: Lisa Crispin
Hard to Automate?
§  Legacy code
     §  Hard to automate, or just lack of skill?
     §  “Working Effectively with Legacy Code” –
         Feathers
     §  “Strangling” – Fowler, Thomas




                                                    40
                     Copyright 2012: Lisa Crispin
Exercise: Low-Hanging Fruit




  Any “easy wins”?

                                              41
               Copyright 2012: Lisa Crispin
Agile Automation Strategy
§  What hurts the most
§  Layered approach
§  Applying agile principles
     §  Small chunks/thin slices
     §  Smart test design
§  Choosing the right tools




                                                     42
                      Copyright 2012: Lisa Crispin
What Hurts the Most
§    Use retrospectives
§    Keep an impediment backlog




                                                     43
                      Copyright 2012: Lisa Crispin
Multi-Layered Approach
Example:
  §  Learn TDD at unit level
  §  Automate GUI smoke tests




                                               44
                Copyright 2012: Lisa Crispin
Simplicity
 §  Address one or two needs at a time
 §  Understand the problem first
 §  Try simplest approach first
 §  Work in small chunks, thin slices
 §  Incremental & iterative




                                                45
                 Copyright 2012: Lisa Crispin
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




                                                    46
                    Copyright 2012: Lisa Crispin
Thin Slice Example




                                             47
              Copyright 2012: Lisa Crispin
Exercise: Thin Slices
Here’s our user story (or theme):
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.

                                                  48
                   Copyright 2012: Lisa Crispin
Test Design Patterns/Principles
                 §    Code design patterns
                 §    One clear purpose
                 §    Don’t Repeat Yourself




                                               49
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.




                                                50
                 Copyright 2012: Lisa Crispin
More on the Page Object Pattern
http://www.beer30.org/?p=54




                                               51
                Copyright 2012: Lisa Crispin
Demo: semi-automating exploratory tests




                                               52
                Copyright 2012: Lisa Crispin
Iterative Feedback
§    Spike two different approaches
§    Pick one to try for N # of iterations
§    Use retrospectives to evaluate




                                                     53
                      Copyright 2012: Lisa Crispin
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
Questions About Automation Strategy?




                                             55
              Copyright 2012: Lisa Crispin
Choosing Tools, Frameworks, Drivers
§    Team effort
§    Time
§    Requirements
§    Focus on goals, problems, not tools.
§    Experiment




                                                    56
                     Copyright 2012: Lisa Crispin
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
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
Test Drivers/Frameworks
§  Divide into sub-teams and prototype
    solutions
§  Have a “bake-off” showing each prototype




                                                59
                 Copyright 2012: Lisa Crispin
Where To Find Tools
§    www.softwareqatest.com/qattls1.html
§    http://bit.ly/AgileTestTools
§    www.testingfaqs.org
§    www.opensourcetesting.org
§    groups.yahoo.com/group/agile-testing
§    Grow your own!




                                                    60
                     Copyright 2012: Lisa Crispin
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
Exercise: Test Frameworks

What format would work for your team? EG,
BDD style? Tables? Assertions? Scenarios?
Think of the test format that might work for
your team. Write examples on sticky notes.
Write down any particular types of test
patterns, frameworks and driverss you want
to learn more about.
and place these sticky notes next to an
impediment it might help overcome..
Discuss with group how that tool might help
solve the problem.   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
Time To Do It Right
§    Limit scope, don’t over-commit
§    Write automation task cards
§    Plan test code maintenance/ refactoring time
§    Quality must be team goal
§    Long-term, will let you go faster




                                                    64
                     Copyright 2012: Lisa Crispin
Bake-offs
§  Have sub-teams/pairs experiment with
    prototypes
§  Budget lots of time for learning,
    experimenting
§  Look at pros & cons




                                                65
                 Copyright 2012: Lisa Crispin
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
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
Managing Automated Tests

§    Tests as Living Documentation
§    Continuous Integration
§    Reporting results
§    Metrics




                                                  68
                   Copyright 2012: Lisa Crispin
Tests as Living Documentation
§  Understandable
§  Who will really use them?
§  Once passing, must always pass




                                                69
                 Copyright 2012: Lisa Crispin
Any Example Can Become a Test




                                            70
             Copyright 2012: Lisa Crispin
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
Continuous integration/testing…
…short feedback loop




                                              72
               Copyright 2012: Lisa Crispin
Keep tests passing
Stop the line to fix problems




                                              73
               Copyright 2012: Lisa Crispin
Test Management Tools
§  Manage tests, code together
§  Some tools have own management
§  What problem are you trying to solve?




                                                 74
                  Copyright 2012: Lisa Crispin
Exercise: Tests as Documentation




                                             75
              Copyright 2012: Lisa Crispin
Key Success Factors

           Thin Slices


                            Specification
                            by Example
              Whole Team
              Approach
Short
Feedback
Loops

                   Experiments
                                     76
Exercise: Breaking Barriers




                                              77
               Copyright 2012: Lisa Crispin
Remember
§    It’s a team problem!
§    Tackle automation problems with diversity
§    Try small experiments
§    Baby steps – start simple




                                                      78
                       Copyright 2012: Lisa Crispin
Questions? “Aha” Moments?




                                            79
             Copyright 2012: Lisa Crispin
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
                          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
Agile Test Automation Resources
§ dhemery.com/pdf/
writing_maintainable_automated_acceptance_tests.pdf
§ http://bit.ly/AgileTestTools
§ lisacrispin.com
§ janetgregory.ca
§ gokjo.net
§ exampler.com
§ agile-testing@yahoogroups.com
§ testobsessed.com
§ testingreflections.com
§ pairwith.us


                                                         85
                          Copyright 2012: Lisa Crispin

Weitere ähnliche Inhalte

Was ist angesagt?

CWIN17 New-York / Drive continuous delivery with continous testing
CWIN17 New-York / Drive continuous delivery with continous testingCWIN17 New-York / Drive continuous delivery with continous testing
CWIN17 New-York / Drive continuous delivery with continous testing
Capgemini
 
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-BrockPragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Joseph Yoder
 
Qa team sport
Qa team sportQa team sport
Qa team sport
LeanDog
 
BBOM-AgilePT-2010
BBOM-AgilePT-2010BBOM-AgilePT-2010
BBOM-AgilePT-2010
Joseph Yoder
 
Software Testing with Agile Requirements Practices
Software Testing with Agile Requirements Practices Software Testing with Agile Requirements Practices
Software Testing with Agile Requirements Practices
A B M Moniruzzaman
 
Flavours of agile software engineering
Flavours of agile software engineeringFlavours of agile software engineering
Flavours of agile software engineering
Zeeshan Masood S
 
Deliver Fast with Confidence
Deliver Fast with ConfidenceDeliver Fast with Confidence
Deliver Fast with Confidence
DevCamp Campinas
 

Was ist angesagt? (20)

Explore Events of Scrum Framework
Explore Events of Scrum FrameworkExplore Events of Scrum Framework
Explore Events of Scrum Framework
 
Improving Tests With Object Mothers And Internal Dsls
Improving Tests With Object Mothers And Internal DslsImproving Tests With Object Mothers And Internal Dsls
Improving Tests With Object Mothers And Internal Dsls
 
Lecture 3 object-oriented design
Lecture 3    object-oriented designLecture 3    object-oriented design
Lecture 3 object-oriented design
 
How Rust Views Tradeoffs
How Rust Views TradeoffsHow Rust Views Tradeoffs
How Rust Views Tradeoffs
 
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...
UXDX London 2018 Nik Crabtree - Enhancing the Processes of Test Driven Develo...
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Raising the Bar
Raising the BarRaising the Bar
Raising the Bar
 
CWIN17 New-York / Drive continuous delivery with continous testing
CWIN17 New-York / Drive continuous delivery with continous testingCWIN17 New-York / Drive continuous delivery with continous testing
CWIN17 New-York / Drive continuous delivery with continous testing
 
Agile Testing Overview
Agile Testing OverviewAgile Testing Overview
Agile Testing Overview
 
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)Leveraging Your Company's DevOps Transformation (AppSec USA 2014)
Leveraging Your Company's DevOps Transformation (AppSec USA 2014)
 
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-BrockPragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
Pragmatic Not Dogmatic TDD Agile2012 by Joseph Yoder and Rebecca Wirfs-Brock
 
Qa team sport
Qa team sportQa team sport
Qa team sport
 
Experience Agile Programming - Kiev
Experience Agile Programming - KievExperience Agile Programming - Kiev
Experience Agile Programming - Kiev
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
 
BBOM-AgilePT-2010
BBOM-AgilePT-2010BBOM-AgilePT-2010
BBOM-AgilePT-2010
 
Essential practices and thinking tools for Agile Adoption
Essential practices and thinking tools for Agile AdoptionEssential practices and thinking tools for Agile Adoption
Essential practices and thinking tools for Agile Adoption
 
Software Testing with Agile Requirements Practices
Software Testing with Agile Requirements Practices Software Testing with Agile Requirements Practices
Software Testing with Agile Requirements Practices
 
Flavours of agile software engineering
Flavours of agile software engineeringFlavours of agile software engineering
Flavours of agile software engineering
 
Deliver Fast with Confidence
Deliver Fast with ConfidenceDeliver Fast with Confidence
Deliver Fast with Confidence
 
How to develop a common sense of "DONE"?
How to develop a common sense of "DONE"?How to develop a common sense of "DONE"?
How to develop a common sense of "DONE"?
 

Ähnlich wie Atd agile automation

Whole Team Approach to Testing, Illustrated
Whole Team Approach to Testing, IllustratedWhole Team Approach to Testing, Illustrated
Whole Team Approach to Testing, Illustrated
lisacrispin
 
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
 
AgileTestingOverview
AgileTestingOverviewAgileTestingOverview
AgileTestingOverview
Umair Anis
 
SQuAD 2013: Team Collaboration for Testing
SQuAD 2013: Team Collaboration for TestingSQuAD 2013: Team Collaboration for Testing
SQuAD 2013: Team Collaboration for Testing
lisacrispin
 

Ähnlich wie Atd agile automation (20)

Making Test Automation Work in Agile Projects 2012
Making Test Automation Work in Agile Projects 2012Making Test Automation Work in Agile Projects 2012
Making Test Automation Work in Agile Projects 2012
 
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
 
Whole Team Approach to Testing, Illustrated
Whole Team Approach to Testing, IllustratedWhole Team Approach to Testing, Illustrated
Whole Team Approach to Testing, Illustrated
 
ACCU Agile Approach to Defect Management
ACCU Agile Approach to Defect ManagementACCU Agile Approach to Defect Management
ACCU Agile Approach to Defect Management
 
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
 
AgileTestingOverview
AgileTestingOverviewAgileTestingOverview
AgileTestingOverview
 
Build Quality In, workshop with Janet Gregory and Lisa Crispin at Agile Roots...
Build Quality In, workshop with Janet Gregory and Lisa Crispin at Agile Roots...Build Quality In, workshop with Janet Gregory and Lisa Crispin at Agile Roots...
Build Quality In, workshop with Janet Gregory and Lisa Crispin at Agile Roots...
 
User testing presentation
User testing presentationUser testing presentation
User testing presentation
 
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
 
Lean day ux_2013-03-01
Lean day ux_2013-03-01Lean day ux_2013-03-01
Lean day ux_2013-03-01
 
Scrum myth buster
Scrum myth busterScrum myth buster
Scrum myth buster
 
Build Your Agile Testing Skill Set
Build Your Agile Testing Skill SetBuild Your Agile Testing Skill Set
Build Your Agile Testing Skill Set
 
What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?What if you could eliminate the hidden costs of development?
What if you could eliminate the hidden costs of development?
 
Agile Anti-Patterns. Yes your agile projects can and will fail too.
Agile Anti-Patterns. Yes your agile projects can and will fail too.Agile Anti-Patterns. Yes your agile projects can and will fail too.
Agile Anti-Patterns. Yes your agile projects can and will fail too.
 
Extreme Programming 2018 — Agile Beyond Scrum
Extreme Programming 2018 — Agile Beyond ScrumExtreme Programming 2018 — Agile Beyond Scrum
Extreme Programming 2018 — Agile Beyond Scrum
 
Global Day of Coderetreat Munich 2018
Global Day of Coderetreat Munich 2018Global Day of Coderetreat Munich 2018
Global Day of Coderetreat Munich 2018
 
Team work
Team workTeam work
Team work
 
SQuAD 2013: Team Collaboration for Testing
SQuAD 2013: Team Collaboration for TestingSQuAD 2013: Team Collaboration for Testing
SQuAD 2013: Team Collaboration for Testing
 
Agile for digital library projects
Agile for digital library projectsAgile for digital library projects
Agile for digital library projects
 
Don't let your tests slow you down
Don't let your tests slow you downDon't let your tests slow you down
Don't let your tests slow you down
 

Mehr von lisacrispin

Do testers have to code... to be useful? Janet Gregory and Lisa Crispin plena...
Do testers have to code... to be useful? Janet Gregory and Lisa Crispin plena...Do testers have to code... to be useful? Janet Gregory and Lisa Crispin plena...
Do testers have to code... to be useful? Janet Gregory and Lisa Crispin plena...
lisacrispin
 
Atd advanced topicsworkshop
Atd advanced topicsworkshopAtd advanced topicsworkshop
Atd advanced topicsworkshop
lisacrispin
 

Mehr von lisacrispin (20)

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 Requirements Exploration: How Testers Add Value
Agile Requirements Exploration: How Testers Add ValueAgile Requirements Exploration: How Testers Add Value
Agile Requirements Exploration: How Testers Add Value
 
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?
 
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
 
Do testers have to code... to be useful? Janet Gregory and Lisa Crispin plena...
Do testers have to code... to be useful? Janet Gregory and Lisa Crispin plena...Do testers have to code... to be useful? Janet Gregory and Lisa Crispin plena...
Do testers have to code... to be useful? Janet Gregory and Lisa Crispin plena...
 
Advanced Topics in Agile Tsting: Focus on Automation
Advanced Topics in Agile Tsting: Focus on AutomationAdvanced Topics in Agile Tsting: Focus on Automation
Advanced Topics in Agile Tsting: Focus on Automation
 
Advanced Topics in Agile Testing - The Future - Agile Testing Days 2014
Advanced Topics in Agile Testing - The Future - Agile Testing Days 2014Advanced Topics in Agile Testing - The Future - Agile Testing Days 2014
Advanced Topics in Agile Testing - The Future - Agile Testing Days 2014
 
Welcome to the Future! Preparing for our agile testing journeys, Agile Testin...
Welcome to the Future! Preparing for our agile testing journeys, Agile Testin...Welcome to the Future! Preparing for our agile testing journeys, Agile Testin...
Welcome to the Future! Preparing for our agile testing journeys, Agile Testin...
 
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
 
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
 
Atd advanced topicsworkshop
Atd advanced topicsworkshopAtd advanced topicsworkshop
Atd advanced topicsworkshop
 

Atd agile automation

  • 1. Making Test Automation Work in Agile Projects Agile Testing Days 2012 Lisa Crispin With Material from Janet Gregory 1
  • 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 2
  • 3. About me… Programmer, tester, agile team member Ever-evolving views on automation 3 Copyright 2012: Lisa Crispin
  • 4. Introduction - You 4 Copyright 2012: Lisa Crispin
  • 5. Takeaways 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 We won’t do any hands-on automation, but will demo some examples 5 Copyright 2012: Lisa Crispin
  • 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 table group “learning goals” sheet §  Group similar ones together 6
  • 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 7 Copyright 2012: Lisa Crispin
  • 8. The key is “sustainable pace” Technical debt slows us down 8 Copyright 2012: Lisa Crispin
  • 10. High technical debt + insufficient automation = even less time Copyright 2012: Lisa Crispin
  • 11. Barriers to Test Automation What’s holding you back? 11 Copyright 2012: Lisa Crispin
  • 12. 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 Work with your group to identify patterns, group similar items 12 Copyright 2012: Lisa Crispin
  • 13. Questions? 13 Copyright 2012: Lisa Crispin
  • 14. The Whole-Team Approach §  Automated tests are code §  Respecting the tests §  Collaborating §  Commitment to quality §  Return on investment 14 Copyright 2012: Lisa Crispin
  • 15. 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 Copyright 2012: Lisa Crispin
  • 16. Source: Gojko Adzic, StarEast 2011 keynote
  • 17. Source: Gojko Adzic, StarEast 2011 keynote
  • 18. Testers are especially good at… § Eliciting examples § Turning them into tests § Ensuring the right testing gets done § Exploratory testing 18 Copyright 2012: Lisa Crispin
  • 19. Give testers time to do what we do best How? 19
  • 21. Experiment: Iteration 1 §  Pair up: one will be tester, one programmer §  Sit back to back so you face away from each other §  Tester: You have a drawing which you need to instruct your developer to draw §  Programmer: Remain silent while working, only do what you’re instructed. §  No talking! §  No peeking! When “done”: §  Programmer – pass your drawing to the tester §  Tester – note problems on separate card/paperWill the customer be happy? 21 Copyright 2012: Lisa Crispin
  • 22. Experiment: Iteration 2 §  Now, turn to face each other. §  Tester: §  Still don’t show your picture! §  Tell the programmer what to draw, but - §  Watch what the programmer draws, and point out any mistakes immediately §  Programmer: §  Still no peeking! §  Ask questions, ask for feedback, make corrections immediately Thanks to the members of the agile-games group and Kane Mar for ideas & pictures for this game 22 Copyright 2012: Lisa Crispin
  • 23. Ways to collaborate Pair: Tester-Coder Tester-Tester Any role – any role 23 Copyright 2012: Lisa Crispin
  • 24. Team responsibility Automate all regression tests 24 Copyright 2012: Lisa Crispin
  • 26. Commitment to quality What’s your team’s commitment? The best possible software product? 26 Copyright 2012: Lisa Crispin
  • 27. Meaningful Commitment Experiment Learn 27 Copyright 2012: Lisa Crispin
  • 28. Under-commit Plan less work than you think you can do Including all test automation Copyright 2012: Lisa Crispin
  • 29. Learn to write maintainable tests §  Get over the “hump of pain” From Gerard Meszaros’ XUnit Test Patterns 29 Copyright 2012: Lisa Crispin
  • 30. Whole-team software development Create a Expand user tests – story Story Tests Automate Write Q2 Tests Pair, Customer Start “Show (Q2) thinking Me” Tests how to code TDD Exploratory testing Product owner Product owner/ Tester Tester Tester/Programmer Programmer Customer User Acceptance 30
  • 31. Exercise • Think of an experiment to get your whole team engaged in automating tests • Share with your table group • Pick two to share with the class Copyright 2012: Lisa Crispin
  • 32. Getting Over the Hump §  The test automation pyramid §  The agile testing quadrants §  What should be automated §  What shouldn't §  Difficult areas 32 Copyright 2012: Lisa Crispin
  • 33. Test Automation Pyramid 33 Copyright 2012: Lisa Crispin
  • 34. Test Automation Volcano From Matt Barcomb Copyright 2012: Lisa Crispin
  • 35. Agile Testing Quadrants 35 Copyright 2012: Lisa Crispin
  • 36. Shared Understanding §  Start with tests §  Collaborate 36 Copyright 2012: Lisa Crispin
  • 37. 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 37 Copyright 2012: Lisa Crispin
  • 38. 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 38 Copyright 2012: Lisa Crispin
  • 39. Where Should We Be Careful? §  GUI tests §  Watch ROI §  End-to-End tests §  Push testing down to lowest level §  Remember the Pyramid 39 Copyright 2012: Lisa Crispin
  • 40. Hard to Automate? §  Legacy code §  Hard to automate, or just lack of skill? §  “Working Effectively with Legacy Code” – Feathers §  “Strangling” – Fowler, Thomas 40 Copyright 2012: Lisa Crispin
  • 41. Exercise: Low-Hanging Fruit Any “easy wins”? 41 Copyright 2012: Lisa Crispin
  • 42. Agile Automation Strategy §  What hurts the most §  Layered approach §  Applying agile principles §  Small chunks/thin slices §  Smart test design §  Choosing the right tools 42 Copyright 2012: Lisa Crispin
  • 43. What Hurts the Most §  Use retrospectives §  Keep an impediment backlog 43 Copyright 2012: Lisa Crispin
  • 44. Multi-Layered Approach Example: §  Learn TDD at unit level §  Automate GUI smoke tests 44 Copyright 2012: Lisa Crispin
  • 45. Simplicity §  Address one or two needs at a time §  Understand the problem first §  Try simplest approach first §  Work in small chunks, thin slices §  Incremental & iterative 45 Copyright 2012: Lisa Crispin
  • 46. 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 46 Copyright 2012: Lisa Crispin
  • 47. Thin Slice Example 47 Copyright 2012: Lisa Crispin
  • 48. Exercise: Thin Slices Here’s our user story (or theme): 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. 48 Copyright 2012: Lisa Crispin
  • 49. Test Design Patterns/Principles §  Code design patterns §  One clear purpose §  Don’t Repeat Yourself 49
  • 50. 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. 50 Copyright 2012: Lisa Crispin
  • 51. More on the Page Object Pattern http://www.beer30.org/?p=54 51 Copyright 2012: Lisa Crispin
  • 52. Demo: semi-automating exploratory tests 52 Copyright 2012: Lisa Crispin
  • 53. Iterative Feedback §  Spike two different approaches §  Pick one to try for N # of iterations §  Use retrospectives to evaluate 53 Copyright 2012: Lisa Crispin
  • 54. 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
  • 55. Questions About Automation Strategy? 55 Copyright 2012: Lisa Crispin
  • 56. Choosing Tools, Frameworks, Drivers §  Team effort §  Time §  Requirements §  Focus on goals, problems, not tools. §  Experiment 56 Copyright 2012: Lisa Crispin
  • 57. 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
  • 58. 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
  • 59. Test Drivers/Frameworks §  Divide into sub-teams and prototype solutions §  Have a “bake-off” showing each prototype 59 Copyright 2012: Lisa Crispin
  • 60. Where To Find Tools §  www.softwareqatest.com/qattls1.html §  http://bit.ly/AgileTestTools §  www.testingfaqs.org §  www.opensourcetesting.org §  groups.yahoo.com/group/agile-testing §  Grow your own! 60 Copyright 2012: Lisa Crispin
  • 61. 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
  • 62. Exercise: Test Frameworks What format would work for your team? EG, BDD style? Tables? Assertions? Scenarios? Think of the test format that might work for your team. Write examples on sticky notes. Write down any particular types of test patterns, frameworks and driverss you want to learn more about. and place these sticky notes next to an impediment it might help overcome.. Discuss with group how that tool might help solve the problem. Copyright 2012: Lisa Crispin 62
  • 63. Making Test Automation Work §  Time to do it right §  Experiments, bake-offs §  Testable architecture §  Test data §  Managing tests 63 Copyright 2012: Lisa Crispin
  • 64. Time To Do It Right §  Limit scope, don’t over-commit §  Write automation task cards §  Plan test code maintenance/ refactoring time §  Quality must be team goal §  Long-term, will let you go faster 64 Copyright 2012: Lisa Crispin
  • 65. Bake-offs §  Have sub-teams/pairs experiment with prototypes §  Budget lots of time for learning, experimenting §  Look at pros & cons 65 Copyright 2012: Lisa Crispin
  • 66. 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
  • 67. 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
  • 68. Managing Automated Tests §  Tests as Living Documentation §  Continuous Integration §  Reporting results §  Metrics 68 Copyright 2012: Lisa Crispin
  • 69. Tests as Living Documentation §  Understandable §  Who will really use them? §  Once passing, must always pass 69 Copyright 2012: Lisa Crispin
  • 70. Any Example Can Become a Test 70 Copyright 2012: Lisa Crispin
  • 71. 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
  • 72. Continuous integration/testing… …short feedback loop 72 Copyright 2012: Lisa Crispin
  • 73. Keep tests passing Stop the line to fix problems 73 Copyright 2012: Lisa Crispin
  • 74. Test Management Tools §  Manage tests, code together §  Some tools have own management §  What problem are you trying to solve? 74 Copyright 2012: Lisa Crispin
  • 75. Exercise: Tests as Documentation 75 Copyright 2012: Lisa Crispin
  • 76. Key Success Factors Thin Slices Specification by Example Whole Team Approach Short Feedback Loops Experiments 76
  • 77. Exercise: Breaking Barriers 77 Copyright 2012: Lisa Crispin
  • 78. Remember §  It’s a team problem! §  Tackle automation problems with diversity §  Try small experiments §  Baby steps – start simple 78 Copyright 2012: Lisa Crispin
  • 79. Questions? “Aha” Moments? 79 Copyright 2012: Lisa Crispin
  • 80. Agile Testing: A Practical Guide for Testers and Agile Teams By Lisa Crispin and Janet Gregory www.agiletester.ca Copyright 2012: Lisa Crispin 80
  • 81. Experiences of Test Automation Dorothy Graham and Mark Fewster Copyright 2012: Lisa Crispin 81
  • 82. 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
  • 83. Test Patterns Xunit Test Patterns: Refactoring Test Code By Gerard Meszaros Copyright 2012: Lisa Crispin 83
  • 84. 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
  • 85. Agile Test Automation Resources § dhemery.com/pdf/ writing_maintainable_automated_acceptance_tests.pdf § http://bit.ly/AgileTestTools § lisacrispin.com § janetgregory.ca § gokjo.net § exampler.com § agile-testing@yahoogroups.com § testobsessed.com § testingreflections.com § pairwith.us 85 Copyright 2012: Lisa Crispin