Professional Documents
Culture Documents
Automation Work in
Agile Projects
Agile Testing Days 2010
Lisa Crispin
With Material from Janet Gregory
Introduction - Me
Programming background
Test automation from mid-90s
Agile from 2000
Many new automation possibilities!
2
Copyright 2010: Lisa Crispin
Introduction - You
Main role on team?
Programming, automation experience?
Using agile approach?
Current level of automation? (Test,
CI,deployment, IDEs, SCCS...)
3
Copyright 2010: Lisa Crispin
Takeaways
Foundation for successful test automation
Whole Team approach
When to automate
Apply agile principles, practices
Good test design principles
Identifying, overcoming barriers
Choosing, implementing tools
First steps
We wont do any hands-on automation, but will work
through some examples together
4
Copyright 2010: Lisa Crispin
Why Automate?
Free up time for most important work
Repeatable
Safety net
Quick feedback
Help drive coding
Tests provide documentation
5
Copyright 2010: Lisa Crispin
6
Copyright 2010: Lisa Crispin
7
Copyright 2010: Lisa Crispin
Initial Investment
Hump of pain
Legacy code, changing code
Tools, infrastructure, time
Effort
Time
Copyright 2010: Lisa Crispin
Its Worth It
9
Copyright 2010: Lisa Crispin
10
Copyright 2010: Lisa Crispin
11
Copyright 2010: Lisa Crispin
Questions?
12
Copyright 2010: Lisa Crispin
13
Copyright 2010: Lisa Crispin
14
Copyright 2010: Lisa Crispin
15
Copyright 2010: Lisa Crispin
16
Copyright 2010: Lisa Crispin
17
Copyright 2010: Lisa Crispin
18
Copyright 2010: Lisa Crispin
Hard to Automate?
Legacy code
Hard to automate, or just lack of skill?
Working Effectively with Legacy Code
Feathers
Strangling Fowler, Thomas
19
Copyright 2010: Lisa Crispin
Discussion
Where should you start?
Is there low-hanging fruit?
Whats the best ROI?
Or the most critical area?
20
Copyright 2010: Lisa Crispin
21
Copyright 2010: Lisa Crispin
22
Copyright 2010: Lisa Crispin
Multi-Layered Approach
Example:
Developers address unit tests
While testers write GUI smoke tests
23
Copyright 2010: Lisa Crispin
Whole-Team Approach
Testable architecture
24
Copyright 2010: Lisa Crispin
Discussion
25
Copyright 2010: Lisa Crispin
26
Copyright 2010: Lisa Crispin
27
Copyright 2010: Lisa Crispin
28
Copyright 2010: Lisa Crispin
Risk
mitigate risk
with
sufficient
coverage
31
Copyright 2010: Lisa Crispin
32
Copyright 2010: Lisa Crispin
Extract duplication
Reusable components
Macros, modules, variables, classes, mixins
Build/Operate/Check
Rerunnable
33
Copyright 2010: Lisa Crispin
34
Copyright 2010: Lisa Crispin
35
Copyright 2010: Lisa Crispin
Unit tests
FitNesse tests
Canoo WebTest scripts
36
Copyright 2010: Lisa Crispin
Iterative Feedback
Commit to trying new tool/framework/
technique for N iterations
Plan automation tasks for each iteration
Use retrospective to evaluate
37
Copyright 2010: Lisa Crispin
Learn by Doing
Simple design
Pairing
Refactoring
Object-oriented, libraries, modules
Test-first if scripts have logic
Small Chunks
Experiment
38
Copyright 2010: Lisa Crispin
39
Copyright 2010: Lisa Crispin
Choosing Tools
Determine requirements
Do some basic research, compile list
Try each tool
40
Copyright 2010: Lisa Crispin
41
Copyright 2010: Lisa Crispin
42
Copyright 2010: Lisa Crispin
Existing expertise
Some built on open-source libraries
Fast ramp-up for non-programmers
Perceived as safe choice
Training, support
Part of existing tool set
May have robust features
New generation of agile tools
43
Copyright 2010: Lisa Crispin
Also changing
Capture-playback problematic
Not designed for long-term maintainability
Newer tools have overcome this
Can be pricey
44
Copyright 2010: Lisa Crispin
45
Copyright 2010: Lisa Crispin
46
Copyright 2010: Lisa Crispin
Home-Brewed - Pros
Programmer-friendly
47
Copyright 2010: Lisa Crispin
Home-Brewed - Cons
Reporting framework
Allow test specification by non-programmers
48
Copyright 2010: Lisa Crispin
www.softwareqatest.com/qattls1.html
www.testingfaqs.org
www.opensourcetesting.org
awta.wikispaces.com/2009ToolsList
groups.yahoo.com/group/agile-testing
http://bit.ly/AgileTestTools - aa-ftt spreadsheet
49
Copyright 2010: Lisa Crispin
IntelliJ Idea
Hudson for CI
JUnit for TDD, unit, component
FitNesse for functional, behind GUI
Canoo WebTest for GUI regression smoke tests
Watir to aid exploratory testing
JMeter for load, performance testing
Perl scripts for comparing files, making files
human-readable
Java programs for concatenating forms, cover
letters
50
Copyright 2010: Lisa Crispin
Discussion
Do you have tool success (or failure) stories to
share?
51
Copyright 2010: Lisa Crispin
Time to do it right
Learning culture
Testable architecture
Test data
Managing tests
52
Copyright 2010: Lisa Crispin
Time To Do It Right
53
Copyright 2010: Lisa Crispin
Learning Culture
OK to make mistakes
Lots of small experiments
Slack
Evolve right design
54
Copyright 2010: Lisa Crispin
Testable Architecture
Layered architecture
eg. UI, business logic, data access
55
Copyright 2010: Lisa Crispin
Test Data
Avoid database access when possible
Setup/Teardown
Independent, rerunnable tests
Canonical data
Refresh before each test run
56
Copyright 2010: Lisa Crispin
Test coverage
57
Copyright 2010: Lisa Crispin
Tests as Documentation
Automated tests can be readable by
everyone
Given/When/Then BDD style is one way
Automation can be hidden or built in
Do or Scenario fixture is another way
58
Copyright 2010: 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
59
Copyright 2010: Lisa Crispin
FitNesse Do Fixture
60
Copyright 2010: Lisa Crispin
62
Copyright 2010: Lisa Crispin
63
Copyright 2010: Lisa Crispin
64
Copyright 2010: Lisa Crispin
65
Copyright 2010: Lisa Crispin
Exercise
Look at the barriers from the first exercise.
Whats the first thing you will do when you get
back to the office to overcome a barrier to
automation? Write it on a post-it and put it next
to the barrier on the flip chart paper.
66
Copyright 2010: Lisa Crispin
Remember
67
Copyright 2010: Lisa Crispin
68
Copyright 2010: Lisa Crispin
70
Copyright 2010: Lisa Crispin
www.agiletester.ca
Copyright
71 2010: Lisa Crispin
Now Available
Beautiful Testing: Leading Professionals Reveal How
They Improve Software
Edited by Tim Riley, Adam Goucher
Includes chapter by yours truly
Copyright
72 2010: Lisa Crispin
Test Patterns
Xunit Test Patterns: Refactoring Test Code
By Gerard Meszaros
Copyright
73 2010: Lisa Crispin
74
Copyright
Copyright
2008 Janet
2010:
Gregory,
Lisa Crispin
DragonFire