janet gregory, dragonfire inc. copyright 2013 sdc 2013 goteborg, sweden
TRANSCRIPT
Janet Gregory, DragonFire Inc.Copyright 2013
ATDD(Acceptance Test Driven Dev)
SDC 2013Goteborg, Sweden
Copyright 2013 DragonFire Inc.
1. Intro
2. Tiny bit about agile
3. What is ATDD
4. Work through an example
5. Wrap-up
Clarifying questions accepted throughout
Q & A after
Copyright 2013 DragonFire Inc. 3
A little about me – twitter: janetgregoryca
First agile team – 2000
Currently – coaching, testing
Book – Agile Testing; January 2009
Copyright 2013 DragonFire Inc.
• Programmers?• Testers?• Business stakeholders?• Other?
• Who has an understanding of TDD?• Who has an understanding of ATDD?
A little about you
Copyright 2013 DragonFire Inc. 5
Testing on agile projects is ……..
• more than “just” testing code• an activity; not a phase
Potentially shippable product
Potentially shippable product
Copyright 2013 DragonFire Inc.
Feature / Epic
Stories
Tasks
• some business capability that is releasable
• pieces of functionality that can be implemented in 2 -3 days
• small chunks of work for a team member (usually less than 1 day
has
man
y
has
man
y
Copyright 2013 DragonFire Inc.
ATDD BDD
EDD TDD
“Begin with the end in mind.” — Stephen R. Covey
Specification
by Example
Picture by Augusta Evangelisti, based on diagram from Elisabeth Hendrickson
Featuresor
Copyright 2013 DragonFire Inc. 10
ATDD (Acceptance Test Driven Development)
UserStory
ExpandTests
High levelAT
Auto-mate tests
TDD&
Execute tests
Explore
++ other testing
AcceptStory
Fix defects
Explore examples
Copyright 2013 DragonFire Inc.
Tests / Examples
Test Method / Fixture
Developer Code
passes to
calls
API test structure
Test
Fra
mew
ork
Create account with user name and password
High level acceptance tests to start the conversation
Let’s look at an example story
User Name Password Expected result comments
JanetGregory Password Access system as JanetGregory
Valid combo saved
Janet Gregory Password Error Space in user name
JanetGregory Abc Error Invalid password
Copyright 2013 DragonFire Inc.
1. What constitutes valid / invalid user names?2. What constitutes valid / invalid passwords?3. I notice you don’t have a confirm password … Is
that something we overlooked? 4. What happens if you have duplicate use
names?5. Can there be more than one password the
same?6. How many times can they make a mistake?
Questions we may ask…
More examples formalized into tests
14
User Name Password Password2 Expected result Comments
JanetGregory Password Password
Access system as JanetGregory
Valid combo saved
Janet Gregory Password Password Error Space in user name
Janet#Gregory Password Password Error Special char not allowed
Password Password Error Blank user name
JanetGregory Password Password2 Error Confirm password does not match
JanetGregory Password Password Error User already exists
JanetGregory Abc Abc Error Not enough char in password
JanetGregory Error Blank password
Copyright 2013 DragonFire Inc.
• Fit• FitNesse• Cucumber• Robot, framework• jBehave / Rspec• SpecFlow• Easyb• rSpec• Groovy• Concordia• ….. etc….
It’s not about the tools !!!
It depends on your
context
Copyright 2013 DragonFire Inc. 16
• Examples provide common language• Defines a DSL (domain specific language)• Shared common understanding of the problem• Shared definition of DONE• Coding and testing concurrently• Involves whole team• Prevents defects• Executable specifications: living documentation• Test at the API level (usually) – faster tests
Benefits of ATDD
Copyright 2013 DragonFire Inc. 17
ATDD and TDD are not enough!
• Exploratory testing◦for things we didn’t think about• Thinking about quality attributes / constraints◦ for ‘fit and finish’
Don’t get complacent
Copyright 2013 DragonFire Inc.
• Markus Gartner, ATDD by Example• Gojko Adzic, Bridging the Communication Gap• http://testobsessed.com/wp-content/
uploads/2011/04/atddexample.pdf• http://testobsessed.com/• Elisabeth Hendrickson, Explore It!• Ellen Gottesdiener and Mary Gorman,
Discover to Deliver
Additional reading
Copyright 2013 DragonFire Inc.
Now AvailableAgile Testing: A Practical Guide for Testers and Agile Teams
By Lisa Crispin and Janet Gregory www.agiletester.ca
My contact info
www.janetgregory.cahttp://janetgregory.blogspot.com/Email: [email protected]
www.lisacrispin.comhttp://lisacrispin.comEmail: [email protected]
19