AgileBill
Krebs
Enterprise
Open
Distributed
Years 30
Books 240
Certs 8
Badges 6
Agile ‘01
Agile3d Academy
Agile Quality
O, Rq, Pm, Qa, Ns, …
Agile Testing: A Practical Guide for Testers and Agile Teams
By Lisa Crispin and Janet Gregory
http://janetgregory.blogspot.com/
(c) 2011 Agile Diimensions LLC CC BY SA
Color coded roles
BA, Test, Dev, PM
(c) 2011 Agile Diimensions LLC CC BY SA
A Two Week Sprint
Stretch
Later
Releases
Sprint
Backlog
m t w t f
M T W T F Product
Demo
Process
Retro
Time
In Release
Product Backlog
Every day: • Standup at task board • Pair, unit test, refactor, review • Test, integrate, build, test
(c) 2011 Agile Diimensions LLC CC BY SA
A User Story – Building Block
As an online shopper, I can ship to a friend
Ron Jefferies 3 ‘C’s
Card
Talk with Bob, my stakeholder
Test: No more, No Less: [x] Can retrieve friend’s address [ ] Can specify ship date and carrier [ ] Can track order
Conversation
Confirmation
(c) 2011 Agile Diimensions LLC CC BY SA
BDD Triggers
Given
When
Then
And
(c) 2011 Agile Diimensions LLC CC BY SA
BDD. Noun. “Behavioural Driven Development”
Given the user has no existing account
When they request to create a new account,
Then they are presented with a screen to enter a valid user name and valid password per rules as defined on our team wiki
And the information is saved upon submitting.
Example BDD Acceptance Test
7 (c) 2011 Agile Diimensions LLC CC BY SA
From http://testobsessed.com/wp-content/uploads/2011/04/atddexample.pdf by Elisabeth Hendrickson
(c) 2011 Agile Diimensions LLC CC BY SA
From http://testobsessed.com/wp-content/uploads/2011/04/atddexample.pdf by Elisabeth Hendrickson
(c) 2011 Agile Diimensions LLC CC BY SA
CI QA
From http://testobsessed.com/wp-content/uploads/2011/04/atddexample.pdf by Elisabeth Hendrickson
(c) 2011 Agile Diimensions LLC CC BY SA
The 5 minute cycle
(c) 2011 Agile Diimensions LLC CC BY SA IndustrialLogic.com
Acceptance Test
(c) 2011 Agile Diimensions LLC CC BY SA
Fixtures
(c) 2011 Agile Diimensions LLC CC BY SA
Column Action Row Calculate Set
(c) 2011 Agile Diimensions LLC CC BY SA
A Sprint Calendar
Mon T W T Fri
Plan Do Do Do Do
Do Do Do Do Demo Retro
Do
(c) 2011 Agile Diimensions LLC CC BY SA
( Refine )
Test
Dev
[ Pair, UT, Refactor ]
CI-Build
Meet
Daily
Extreme Quality
Traditional Extreme
Code Inspections Pair Programming
Unit Test Automated Unit Test
(Test Driven Development?)
Daily Builds Continuous Integration
(c) 2011 Agile Diimensions LLC CC BY SA
Pairing
• Two people, one computer. Switch
• Save ½ the bugs for +15% labor
• Best benefits are intangible
(c) 2011 Agile Diimensions LLC CC BY SA
Microsoft Research
• “Pair Programming – What’s in it for me” Andrew Begel, Nachiappan Nagappan , Microsoft Research http://research.microsoft.com/pubs/75108/esem-begel-2008.pdf
Pair programming is a practice in which two programmers work collaboratively at one computer on the same design, algorithm, or code. Prior research on pair programming has primarily focused on its evaluation in academic settings. There has been limited evidence on the use, problems and benefits, partner selection, and the general perceptions towards pair programming in industrial settings. In this paper we report on a longitudinal evaluation of pair programming at Microsoft Corporation. We find from the results of a survey sent to a randomly selected 10% of engineers at Microsoft that 22% pair program or have pair programmed in the past. Using qualitative analysis, we performed a large-scale card sort to group the various benefits and problems of pair programming. The biggest perceived benefits of pair programming were the introduction of fewer bugs, spreading code understanding, and producing overall higher quality code. The top problems were cost-efficiency, (work time) scheduling problems, and personality conflicts. Most engineers preferred a partner who had complementary skills to their own, who was flexible and had good communication skills.
(c) 2011 Agile Diimensions LLC CC BY SA
Top 10 Benefits (%)
66 Fewer Bugs 42 Spreads Code Understanding 48 Higher Quality Code 42 Can Learn from Partner 30 Better Design 22 Constant Code Reviews 22 Two Heads are Better than One 17 Creativity and Brainstorming 14 Better Testing and Debugging 13 Improved Morale
(c) 2011 Agile Diimensions LLC CC BY SA
Formal Inspection
• Different styles
• Save ½ the bugs for +15% labor
• Does it fit in a 3 day story?
(c) 2011 Agile Diimensions LLC CC BY SA
Cost of change
0
10
20
30
40
50
60
70
80
90
100
a b c d e f g h i j
Series 1
Place these:
(c) 2011 Agile Diimensions LLC CC BY SA
Customer bug
Inspection
Build
QA bug
Pairing
Unit Test
$$
Time ->
Patterns
(c) 2011 Agile Diimensions LLC CC BY SA
(c) 2011 Agile Diimensions LLC CC BY SA
Refactor these Smells I
Group Smells
Duplication Alternative classes, Duplicated code
Names Inconsistent, Type embedded, uncommunicative
Code issues Complicated boolean expression, Long method, long param list, magic number, null check, simulated inheritance
Class Too many instance variables, methods, or lines
Complexity Dead code, speculative generality
(c) 2011 Agile Diimensions LLC CC BY SA
See Refactoring Workbook, by William Wake
Refactor these Smells II
Group Smells
Data Data class, data clump, primitive obsession, temporary field
Inheritance Inappropriate intimacy (subclass from), Lazy class, Refused Bequest
Responsibility Feature envy, inappropriate Intimacy (general), message chain,
Accommodating Change
Combinatorial explosion, divergent change, parallel inheritance hierarchies, shotgun surgery
Libraries Incomplete library
(c) 2011 Agile Diimensions LLC CC BY SA
See Refactoring Workbook, by William Wake
Q A
(c) 2011 Agile Diimensions LLC CC BY SA
Agile Testing Quadrants (Brian Marick)
Agile Testing Quadrants
Agile Testing Quadrants
Agile Testing Quadrants
Agile Testing Quadrants (Brian Marick)
Agile Testing Pyramid (Mike Cohn)
To Automate or not?
• Usability tests?
• Manual exploratory testing?
• Customer testing?
• Prototype code?
(c) 2011 Agile Diimensions LLC CC BY SA
Engineer test code for the long term
• Design Patterns
• Inspect or Pair
• Readable code
• Refactor
• Object Orient reuse
• Design testability into your system
(c) 2011 Agile Diimensions LLC CC BY SA
Test Data
• Should we mock out database calls?
• Should we we use real customer data?
(c) 2011 Agile Diimensions LLC CC BY SA
Assemble this puzzle
(c) 2011 Agile Diimensions LLC CC BY SA
Write acceptance test
Create a Story TDD
Refactor
Automate
Show the Tester
Exploratory Test
Customer Test
Dev
BA
QA
Cust
Acceptance Test – BDD Style
BDD – Behavioural Driven Development
Given the user has no existing account
When she requests to create a new account,
Then she is presented with a screen to enter a valid user name and valid password (rules defined on wiki)
And the information is saved upon submitting.
(c) 2011 Agile Diimensions LLC CC BY SA
37
Continuous Integration (CI)
(c) 2011 Agile Diimensions LLC CC BY SA
41
API Test Tools
◦ Fit, FitNesse, Cucumber, Robot Framework, Concordion, JBehave, Jubala, GUI Dancer
GUI Test Tools
◦ Selenium, Watir, Canoo WebTest, Twist, rSpec Unit Test Tools
◦ jUnit, nUnit, WatiN (UI), WatiJ, White Web Services
◦ CrossCheck, SoapUI, Ruby test::unit Misc.
◦ Dbfit
Examples of Automation Tools
(c) 2011 Agile Diimensions LLC CC BY SA
42
Read more
via Janet Gregory – co-author of Agile Testing
• http://bit.ly/AgileTestTools
• softwareqatest.com
• opensourcetesting.org
• testingfaqs.org
• http://janetgregory.blogspot.com/
• http://lisacrispin.com/
• http://www.exampler.com/testing-com/agile/
(c) 2011 Agile Diimensions LLC CC BY SA
(c) 2011 Agile Diimensions LLC CC BY SA
1 3 5 7 9
Standup 9 None "ABCs" weekly Stand Up Finish in under
15 minuites "ABC's" are
common
Task Board 1 None Have Organized Remote Limit WIP
Burndown 9 None Have Update In 1 Sigma Decide
Code Review 9 None Some Common Efficient Styles
Dev Unit Test 3 None Do Auto In Build Tandem
Automated QA Test 8 None Have Use Sufficient Measure Coverage
QA 8 None Chunks TETO (Test Eary,
Test Often) Exploratory "ility" testing
Build 1 None Automation "Daily" Auto Tests On demand &
Visible
Done Done Done 7 None Defined 50% met 80% met 95% met
Quality Advocate
Does Development
• Inspect or Pair?
• TDD or Automated Unit Test?
• Automate Acceptance Tests? (FIT)
• Use Continuous Integration?
(c) 2011 Agile Diimensions LLC CC BY SA