guide to atdd · business value “done” means done frequent delivery alignment. defining...
TRANSCRIPT
The Business and Test Analysts’ Guideto
Acceptance Test-Driven Development
1
Dale EmeryWeb: dhemery.comTwitter: @dhemery
A Caveat
2
When I talk about“Business Analysts” and “Testers” and
“Developers”
I do not mean job titles
I mean anyone who is using these particular skills at a particular time
Defining Agile by Results
3
Agile means that the team
continuously delivers business value
at a sustainable pace
while adaptingto the changing needs of the business
Team-FocusedCharacteristics
Characteristics of Agile Teams
4
Business-Focused Characteristics
Coordination
Visibility
Feedback
CollaborationFocus onBusiness Value
“Done” means Done
Frequent Delivery
Alignment
Defining Acceptance Test Driven Development (ATDD)
5
Acceptance Test Driven Developmentis a practice in which
the whole team collaboratesto discuss acceptance criteria
with examplesand then distills them
into a concrete set of acceptance testsbefore development begins
The ATDD Cycle
6
TDD
Develop
DiscussAs Bart Bookworm I want to be told when new releases are vailable at a discount.
Demonstrate
Who What When Why
Me Fish 9am Eat
You Rose noon Grow
Us Toys 3pm Play
DistillGiven ...When ...Then ...
Discuss: What Happens
7
storystory
Discuss: Who does What• Business Analysts! Describe the feature! Answer questions! Decide acceptance criteria
• Testers and developers! Ask questions to test understanding, probe
ambiguities, and define boundaries" What if ...?" Do you mean ...?
• Everybody! Offer and request examples to test and express
understanding 8
Example: Entaggle
9
Discussion
Display the tags in a “Has Tagged...” tab on the profile
Donʼt show tags until they are accepted
If the user hasnʼt tagged anyone, say“... has not tagged anyone yet”
Discuss: Entaggle.com
Story
On a userʼs profile page, show the tags that the user has given to other users
10
Distill: What Happens
11
story with Examples
story
Distill: Who does What• Everybody! The same as Discuss, plus! Write acceptance criteria in the form of precise,
concise, expressive examples...! ... possibly in a format that can be directly
automated...! ... possibly directly in a test tool
12
Distill: Entaggle.comBackground: Given users: | username | first_name | last_name | | arthur | Arthur | Pendragon | | black_knight | Black | Knight | And the tag "A Knight of Agile"
13
Scenario: Display tags others have accepted from the user When "black_knight" tags "arthur" as "A Knight of Agile" And "arthur" accepts the tag "A Knight of Agile" Then the "Has Tagged..." tab for "black_knight" displays: | recipient | tag name | | Arthur Pendragon | A Knight of Agile |
Distill: Entaggle.com
Scenario: Indicate when the user has not yet tagged anyone Given that "black_knight" has not tagged anyone Then the "Has Tagged..." tab for "black_knight" displays: """ Black has not tagged anyone yet. """
14
Scenario: Display only accepted tags When "black_knight" tags "arthur" as "A Knight of Agile" But "arthur" has not accepted the tag "A Knight of Agile" Then the "Has Tagged..." tab for "black_knight" displays: """ Black has not tagged anyone yet. """
Develop: What Happens
15 This
slid
e C
opyr
ight
© 2
011
Elis
abet
h H
endr
icks
on, Q
ualit
y Tr
ee S
oftw
are,
Inc.
CC
lice
nsed
.
storypartially implemented story
implemented story
The Test SystemThe SystemUnder Test
Develop: What Happens
16
GUI
SystemfunctionalityTests Fixture
code
Driver
Develop: Who does What• Developers! Implement the feature! Work with testers to automate tests! Run acceptance tests
• Testers! Work with developers to automate tests! Conduct exploratory testing! Run acceptance tests
• Business Analyst! Answer questions as they arise
17
Demo: Who Does What• Developers! Help prepare the demo! Answer questions
• Testers! Help prepare the demo! Perhaps arrange to execute the acceptance
tests! Answer questions about test activities and
results• Business Analyst / Product Owner! Decide whether to accept the feature
18
Demo: Entaggle.com
19
Testers: Same and Different• Same• Still use all of your testing skill and expertise
Different• Apply testing skills early and throughout the
project• Define tests at the start, not at the end• Your value is not only in finding problems, but
also in helping to prevent them• Test each feature as soon as it is available• Much more emphasis on automation• You (might) help automate tests• All one team 20
Business Analysts:Same and Different
Same• Still use all of your analysis skill and expertise
Different• Deliver features to the team in smaller batches,
perhaps one at a time• Collaborate with other team members to create
shared understanding• Express acceptance criteria as potentially
automatable tests• Remain available to the team to provide guidance
throughout development• Review progress and “done” more frequently
21
Resources• Agile Testing. Lisa Crispin and Janet Gregory.• Agile Product Management with Scrum. Roman
Pichler.• Bridging the Communcation Gap. Gojko Adzik.• Specification by Example. Gojko Adzik.• User Stories Applied. Mike Cohn.• “Driving Development with Tests: ATDD and TDD.”
Elisabeth Hendrickson. http://testobsessed.com/wp-content/uploads/2011/04/atddexample.pdf
22