atdd (acceptance test driven dev)

19
Janet Gregory, DragonFire Inc. Copyright 2013 ATDD (Acceptance Test Driven Dev) SDC 2013 Goteborg, Sweden

Upload: perry

Post on 08-Feb-2016

195 views

Category:

Documents


1 download

DESCRIPTION

ATDD (Acceptance Test Driven Dev). SDC 2013 Goteborg, Sweden. Intro Tiny bit about agile What is ATDD Work through an example Wrap-up Clarifying questions accepted throughout Q & A after. A little about me – twitter: janetgregoryca. First agile team – 2000 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: ATDD (Acceptance Test Driven Dev)

Janet Gregory, DragonFire Inc.Copyright 2013

ATDD(Acceptance Test Driven Dev)

SDC 2013Goteborg, Sweden

Page 2: ATDD (Acceptance Test Driven Dev)

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

Page 3: ATDD (Acceptance Test Driven Dev)

Copyright 2013 DragonFire Inc. 3

A little about me – twitter: janetgregoryca

First agile team – 2000

Currently – coaching, testing

Book – Agile Testing; January 2009

Page 4: ATDD (Acceptance Test Driven Dev)

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

Page 5: ATDD (Acceptance Test Driven Dev)

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

Page 6: ATDD (Acceptance Test Driven Dev)

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

Page 7: ATDD (Acceptance Test Driven Dev)

Copyright 2013 DragonFire Inc.

ATDD BDD

EDD TDD

“Begin with the end in mind.” — Stephen R. Covey

Specification

by Example

Page 8: ATDD (Acceptance Test Driven Dev)
Page 9: ATDD (Acceptance Test Driven Dev)

Picture by Augusta Evangelisti, based on diagram from Elisabeth Hendrickson

Featuresor

Page 10: ATDD (Acceptance Test Driven Dev)

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

Page 11: ATDD (Acceptance Test Driven Dev)

Copyright 2013 DragonFire Inc.

Tests / Examples

Test Method / Fixture

Developer Code

passes to

calls

API test structure

Test

Fra

mew

ork

Page 12: ATDD (Acceptance Test Driven Dev)

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

Page 13: ATDD (Acceptance Test Driven Dev)

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…

Page 14: ATDD (Acceptance Test Driven Dev)

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

Page 15: ATDD (Acceptance Test Driven Dev)

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

Page 16: ATDD (Acceptance Test Driven Dev)

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

Page 17: ATDD (Acceptance Test Driven Dev)

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

Page 18: ATDD (Acceptance Test Driven Dev)

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

Page 19: ATDD (Acceptance Test Driven Dev)

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