© 2021 Robert Sabourin 1
GETTING THINGS DONEWHAT TESTERS DO IN AGILE SPRINTS
Agile Testing Blends …
• Doing the right thing
• Eliciting user stories
• Domain knowledge
Validation
• Doing the thing right
• Test-driven development
• Automated story testing
Verification
• Learning
• Adapting
• “To boldly go ...”
Exploration
© 2015 Robert Sabourin 2
1
2
© 2021 Robert Sabourin 2
Testing Is a Skill Set
Skills
• Specialized
• Competencies
• Approaches
• Methods
• Techniques
© 2015 Robert Sabourin 3
Testing in Agile Projects Supports…
• Customers
• Developers
• “Stakeholders”
© 2015 Robert Sabourin 4
3
4
© 2021 Robert Sabourin 3
Scrum
© 2015 Robert Sabourin 5
Quality
• Agile teams do not have quality police
© 2015 Robert Sabourin 6
5
6
© 2021 Robert Sabourin 4
Quality
• Agile team members share responsibility for product quality
© 2015 Robert Sabourin 7
Team Approach to Testing
• Testing activities
– Testing activities can be done by any suitably qualified team members
– Development activities can be done by any suitably qualified team members
– Developers should be able to take on some testing activities
– Testers should be able to take on some development activities
© 2015 Robert Sabourin 8
7
8
© 2021 Robert Sabourin 5
Coaching
Programmers
Testers
© 2015 Robert Sabourin 9
TESTING’S ROLE IN PLANNING
Planning
© 2015 Robert Sabourin 10
9
10
© 2021 Robert Sabourin 6
Testing’s Role in Planning
Testing is a critical part of planning
Elaborate and clarify story tests with customers and users
Identify testing activities to support development
© 2015 Robert Sabourin 11
BACKLOG GROOMING
Planning
© 2015 Robert Sabourin 12
11
12
© 2021 Robert Sabourin 7
Story Grooming Sessions
•High priority stories
•Groomed prior to implementation
•Objectives: understand, clarify, examples, estimate
Improve stories
•Team elicits acceptance tests (examples) from product owner
•Consider normal, alternate and error flows of story
Elicit acceptance tests
•Clarify description
•Explore alternate interpretations
Clear up ambiguities
© 2015 Robert Sabourin 13
Story Grooming Sessions
• All team members participate
• Diverse perspectives discussed
Team building
• Invest a fixed amount of time
• Do not have to review all stories in one session
Time-boxing
• Team estimates story size
• All work is considered
Get team buy in
© 2015 Robert Sabourin 14
13
14
© 2021 Robert Sabourin 8
Story Grooming Sessions
•Clarify & understand story
•Elicit acceptance tests
•Relate new stories to existing functionality
Wisdom: good points
© 2015 Robert Sabourin 15
TESTING ACTIVITIES IN THE SPRINT
Planning
© 2015 Robert Sabourin 16
15
16
© 2021 Robert Sabourin 9
Whiteboarding
Co
mp
are
Desig
n
Alt
ern
ati
ves
© 2015 Robert Sabourin 17
Sprint Backlog Tasks
Sprint planning meeting
The team breaks each Sprint backlog entry into tasks
Development, testing and documentation activities are planned together
© 2015 Robert Sabourin 18
17
18
© 2021 Robert Sabourin 10
Testing Activities in Sprint Backlog
Basis for testing
Story
Acceptance tests
Technical work
Product use
Environment
© 2015 Robert Sabourin 19
Testing Activities in Sprint Backlog
Infrastructure tasks
Tools
Frameworks
Test automation
Test environments
© 2015 Robert Sabourin 20
19
20
© 2021 Robert Sabourin 11
Testing Activities in Sprint Backlog
Test data tasks
Generation
Capturing
Organization
Validation
© 2015 Robert Sabourin 21
Testing Activities in Sprint Backlog
Non-functional testing tasks
Experiments to study quality factors
Static analysis
Collecting and analyzing information from test frameworks
© 2015 Robert Sabourin 22
21
22
© 2021 Robert Sabourin 12
Testing Activities in Sprint Backlog
Functional testing tasks
Confirmation of developed features
Story testing
Cross-functional testing
© 2015 Robert Sabourin 23
Testing Activities in Sprint Backlog
Software robustness tasks
Attacks
Failure modes
Error recovery
© 2015 Robert Sabourin 24
23
24
© 2021 Robert Sabourin 13
Testing Activities in Sprint Backlog
Exploratory testing tasks
Close gaps in testing
Look for interactions between stories
Experience-based testing
© 2015 Robert Sabourin 25
Structure Related Testing Activities
• Team explores design alternatives
– Elements being added
– Elements to be changed
– Elements to be deleted
– Third party components being integrated
– Reuse objects
– Repurpose objects
© 2015 Robert Sabourin 26
25
26
© 2021 Robert Sabourin 14
Structure Related Testing Activities
• Team identifies testing tasks related to elements being changed
– Access element being changed
– Gets data from element being changed
– Controls element being changed
– Observes element being changed
– Invokes element being changed
© 2015 Robert Sabourin 27
Structure Related Testing Activities
• Testing tasks relate to exercising
– Other features
– Workflows
– Business process
– Data flows
– Usage scenarios
© 2015 Robert Sabourin 28
27
28
© 2021 Robert Sabourin 15
Testing Activities in Sprint Backlog
• Implement testable code– Controllable
• Ensure all features or characteristics can be controlled• Anything a user can do or an event can trigger should
be controllable
– Observable• Ensure application variables can be set and queried
programmatically
– Defined API exists for all aspects of the product being developed
– Add fixtures to allow for automated story tests
© 2015 Robert Sabourin 29
Static Analysis at Build Time
• When building software many metrics can be captured using static analysis tools
– Code size
– Code complexity
– Code standard compliance
– Potential security risks
© 2015 Robert Sabourin 30
29
30
© 2021 Robert Sabourin 16
TEST-DRIVEN DEVELOPMENT
In the Heat of the Sprint
© 2015 Robert Sabourin 31
Test-Driven Development
www.extremeprogramming.org
“There is a rhythm to developing software unit test first. You create one test to define some
small aspect of the problem at hand. Then you create the simplest code that will make that
test pass. Then you create a second test. Now you add to the code you just created to make this new test pass, but no more! Not until you have yet a third test. You continue until there
is nothing left to test.”
© 2015 Robert Sabourin 32
31
32
© 2021 Robert Sabourin 17
Test-Driven Development
Elisabeth Hendrickson
Quality Tree Software, Inc.
“When practicing TDD, I use each test as a way to express an expectation about the code that isn't true yet. Then I make
that expectation true, refactor the code, and move on to expressing the next expectation. It's a little like writing an
article by deciding what question to answer next in the prose.”
© 2015 Robert Sabourin 33
Test-Driven Development
Begin with the end in mind
Define test
Implement test
Then “Develop the simplest code to pass the test”
© 2015 Robert Sabourin 34
33
34
© 2021 Robert Sabourin 18
Test-Driven Development
How experienced testers may help
Many developers have limited expertise in test design
Test design experts can coach developers and offer peer reviews and critiques to help improve unit tests and design test data sets
© 2015 Robert Sabourin 35
Test-Driven Development
• Robert C. Martin’s Three Laws of Test-Driven Development
1. “You may not write production code until you have written a failing unit test.”
2. “You may not write more of a unit test than is sufficient to fail, and not compiling is failing.”
3. “You may not write more production code than is sufficient to pass the currently failing test.”
© 2015 Robert Sabourin 36
35
36
© 2021 Robert Sabourin 19
Test-Driven Development
Red Green Refactor
Kent
Beck© 2015 Robert Sabourin 37
ACCEPTANCE TEST DRIVEN DEVELOPMENT
In the Heat of the Sprint
© 2015 Robert Sabourin 38
37
38
© 2021 Robert Sabourin 20
Acceptance Test Driven Development
ATDD
Business facing examples
Elicited from customers
Concrete goals
Guide and focus development
Basis for top down regression
© 2015 Robert Sabourin 39
Acceptance
Test Driven
Development
© 2015 Robert Sabourin 40
39
40
© 2021 Robert Sabourin 21
BEHAVIOUR DRIVEN DEVELOPMENT
In the Heat of the Sprint
© 2015 Robert Sabourin 41
Behaviour Driven Development
• David Chelimsky - 2010
– “Behaviour-driven development is about implementing an application by describing its behavior from the perspective of its stakeholders.”
© 2015 Robert Sabourin 42
41
42
© 2021 Robert Sabourin 22
Behaviour Driven Development
• Describing behaviour
– Given
• Something true
• A precondition
– When
• Event
• Trigger
– Then
• Expected outcome
• Ending state
© 2015 Robert Sabourin 43
Behaviour Driven Development
• Example description with Given/When/Then tirade:
Given I have $100 in checking
And I have $20 in savings
When I transfer $15 from checking
to savings
Then I should have $85 in checking
And I should have $35 in savings
© 2015 Robert Sabourin 44
43
44
© 2021 Robert Sabourin 23
EXPLORATORY TESTING
In the Heat of the Sprint
© 2015 Robert Sabourin 45
Exploratory Testing
Learning
DesignExecution
© 2015 Robert Sabourin 46
45
46
© 2021 Robert Sabourin 24
Exploratory Testing
• “Exploratory software testing is a style of software testing that emphasizes the personal freedom and responsibility of the individual tester to continually optimize the value of her work by treating test-related learning, test design, test execution, and test result interpretation as mutually supportive activities that run in parallel throughout the project.”
— Cem Kaner’s Blog :
On the craft and community of software testing
© 2015 Robert Sabourin 47
Exploratory Testing: A New Perspective
Find gaps in automated
tests
Holes
Omissions
Inconsistencies
Emergent behaviors
Surprises
Side effects
Weakness
Attributes across story boundaries
Security
Performance
Characteristics
© 2015 Robert Sabourin 48
47
48
© 2021 Robert Sabourin 25
Charter Statement
• Statement of mission
• Ties to purpose
• Focuses work
• Confirms understanding
• Delineates scope
© 2015 Robert Sabourin 49
Charter Types
• Capabilities
• Across Story Relationships
• Failure Modes
• Robustness
• Quality Factors
• Usage Scenarios
• End to End
• Creative Ideas
• States
• Sequences
• Data
• Environments
• White Box
© 2015 Robert Sabourin 50
49
50
© 2021 Robert Sabourin 26
Exploration Notes
Take notes
about test
decisions
Map out
where you
have been
and what you
discovered
© 2015 Robert Sabourin 51
Timeboxed Sessions
• About two hours
• Uninterrupted
• FocusedTypical
• 15–30 minutes
• Punctual
• ConfirmationsShort
• Several hours or days
• Experiments
• Non-functional chartersLong
© 2015 Robert Sabourin 52
51
52
© 2021 Robert Sabourin 27
Press pause button
• After timebox we stop
• Can resume later
Review findings
• What works?
• What does not work?
• What did we learn?
• What do we want to learn more about?
Did we learn enough?
• Will we benefit from another session on the same charter?
• Should we try a new charter?
At End of Session
© 2015 Robert Sabourin 53
Session-based Exploratory Testing
Kick Off
Prepare
Run
Complete
Review
Follow Up
Confirm charter
Ready environment
Prepare data
Session 90–120 min
Learn Design Execute
Wrap up
Collect all notes data
Review findings
Reassess goals
Piece together map
© 2015 Robert Sabourin 54
53
54
© 2021 Robert Sabourin 28
Pairing Testers with …
•Improve observation
•Feed off other’s experiences
•“XP” ish
Other testers
•White box perspective
•What is it programmed to do?
•What is it supposed to do?
Developers
© 2015 Robert Sabourin 55
Pairing Testers with …
• Access correctness
• Drive from business perspective
• Identify missing functionality
Subject matter experts
• Usability gurus
• Performance engineers
• Security experts
Test domain experts
© 2015 Robert Sabourin 56
55
56
© 2021 Robert Sabourin 29
Heuristics
© 2015 Robert Sabourin 57
Heuristics
Guide exploration
Rules of thumb
Fallible but useful
© 2015 Robert Sabourin 58
57
58
© 2021 Robert Sabourin 30
Some Example Test Heuristics
• Create Read Update DeleteCRUD
• Too Big, Too Small, Just RightGoldilocks
• Application Logic, Input Method, MemoryTake AIM
• Construct ProgressivelyBaby Steps
• Conditions trigger actions?
• Actions caused by conditions?Action/Effect
• Confirm Screen, Database, ReportTriangulate
© 2015 Robert Sabourin 59
Debugging and Troubleshooting
Pair with developer
Work in IDE
Simulate conditions
Tracing code
What if analysis
© 2015 Robert Sabourin 60
59
60
© 2021 Robert Sabourin 31
NON-FUNCTIONAL TESTING
In the Heat of the Sprint
© 2015 Robert Sabourin 61
Non-Functional Testing
Quality Factors
Attributes
Characteristics
Reliability
Other “-ilities”
© 2015 Robert Sabourin 62
61
62
© 2021 Robert Sabourin 32
Non-Functional Testing Challenges
Goals
• Elicit
• Articulate
• Quantify
Subjective
• Needs or wants?
• Relative or absolute?
• What is good enough?
Tests
• Tricky to orchestrate
• Difficult to interpret results
• Challenging to baseline or regress
© 2015 Robert Sabourin 63
Non-Functional Agile Challenges
Time
• Analysis
• Model
• Prepare
• Run
• Interpret
Change
• Baselines
• Goals
Software
• Continuous integration
• Incomplete product builds
© 2015 Robert Sabourin 64
63
64
© 2021 Robert Sabourin 33
Product Backlog Stories
Emphasize system attributes
Security stories
Usability stories
Performance stories
© 2015 Robert Sabourin 65
Product Backlog Constraints
Tom Gilb, Competitive Engineering, suggests defining
Scale: "What is measured"
Meter: "How to measure (method)"
Target: "Level we're aiming for. Success"
Constraint: "Level we're seeking to avoid. Failure"
Benchmark: "Where we are today"
© 2015 Robert Sabourin 66
65
66
© 2021 Robert Sabourin 34
Non-Functional Testing
© 2015 Robert Sabourin 67
Non-Functional Testing
Light tests
•Low source code complexity suggests maintainability
•Slow unit tests suggests performance problems
•Novice user questions suggest usability concerns
© 2015 Robert Sabourin 68
67
68
© 2021 Robert Sabourin 35
Non-Functional Experimentation
• Iterative
• Implement trial
• Measures result
Timebox non-functional tests
• Pause
• Review findingsAfter timebox
• Investigate more
• Refactor goal
• Move on to something elseNext steps
© 2015 Robert Sabourin 69
Non-Functional Testing
Daily performance tests
Decide what experiment to run
Review results in stand-up meeting
Decide what to do next
Use a flexible tool set
© 2015 Robert Sabourin 70
69
70
© 2021 Robert Sabourin 36
Non-Functional Testing
Instrumentation, hooks, and logs
• Isolate bottlenecks
•Resource usage
•Load generation
•System monitoring
© 2015 Robert Sabourin 71
Non-Functional Long Tests
Continuously running tests
Frequently pause and restart with new builds
Runs typical transactions in simulated realistic environment
© 2015 Robert Sabourin 72
71
72
© 2021 Robert Sabourin 37
CUSTOMER DEMO
At Sprint’s End
© 2015 Robert Sabourin 73
Customer Demo
No surprises
Tradeoffs acceptable
Priorities understood
© 2015 Robert Sabourin 74
73
74
© 2021 Robert Sabourin 38
Customer Demo
Demonstrate functionality
•Exercise all story tests
•Demonstrate relationships
•New stories
•Existing functionality
© 2015 Robert Sabourin 75
Customer Demo
Demonstrate non-functional product characteristics
•Non-functional backlog entries
•Performance
•Constraints
© 2015 Robert Sabourin 76
75
76
© 2021 Robert Sabourin 39
RETROSPECTIVE
At Sprint’s End
© 2015 Robert Sabourin 77
Retrospective
•Review by team of work done
•Review what worked well
•Review what did not work well
Work done
during sprint
© 2015 Robert Sabourin 78
77
78
© 2021 Robert Sabourin 40
Retrospective
Test improvements
•Any wasted time?
•Any missing tasks?
•Any concerns about automation?
© 2015 Robert Sabourin 79
Retrospective
•Strengths
•Weakness
•New ideas
Testability
© 2015 Robert Sabourin 80
79
80
© 2021 Robert Sabourin 41
Retrospective
Collaboration concerns
Customers
Developers
Other teams
Suppliers
Synchronicity
© 2015 Robert Sabourin 81
Retrospective
Bugs found
• Any common cause?
• How can we avoid them?
• How were bugs injected?
© 2015 Robert Sabourin 82
81
82