Introduction to Acceptance Test Driven Development

E
Elisabeth HendricksonAgile Consultant. Tester-Developer. Writer. Geek. Test Obsessed. um Quality Tree Software, Inc.
Beginning with the End
               in Mind: Driving
               Development with
               Acceptance Tests
                Elisabeth Hendrickson
                Quality Tree Software, Inc.
                www.qualitytree.com
                esh@qualitytree.com



                                      Last updated November 10, 2009
This work is licensed under the Creative Commons Attribution 3.0
United States License. View a copy of this license.
What is ATDD?
Acceptance-Test Driven Development (ATDD) Cycle
                        0&1(/.2
                        3,.4#15
                        -21&6
                        -21&6
                        -21&6
                        -21&6
                        -21&6




                                                                          Copyright © 2010 Quality Tree Software, Inc.
          0&1(/.2
                                  !$-./--                 '" (




                                                 *
                                                 + #" ,




                                                                 ) &" "
                                                                 *
                    !"#$%"&                 !"%"#17
(Model developed with Pekka Klärck, Bas Vodde, and Craig Larman.)
ATDD: Discuss



          !"#$%&'
          ()&*+#,                                  !"#$%&




                                                                  Copyright © 2010 Quality Tree Software, Inc.
                                                '(&%$)*#(&+(,
           -'#".
           -'#".
           -'#".
           -'#".                                     Concrete
                                                  Examples with
           -'#".                                   Expectations




(Slide developed in collaboration with Pekka Klärck.)
ATDD: Develop

                                          '*&+%","-."/,/




                                                           Copyright © 2010 Quality Tree Software, Inc.
                                          '()*+"&
                                           %#$&
                    !"#                     ,-(*
                                            .&/*/
                                              !"#$
           &
           ' (" )




                           $ %" "




                                              %#$&
                           &




(Slide developed in collaboration with Pekka Klärck.)
ATDD: Deliver




                                                        Copyright © 2010 Quality Tree Software, Inc.
                               Product
                            Feature Feature
                       Feature Feature
                            Feature
                       Feature
                            FeatureFeature
                           Feature
(Slide developed in collaboration with Pekka Klärck.)
Introducing an Example
Start with the Story



As an administrator, I want users
creating accounts to be required




                                    Copyright © 2010 Quality Tree Software, Inc.
to choose secure passwords so
that their accounts cannot be
hacked by someone using a
password guessing program.
Discuss
And if a user provides                           Who’s in the
an insecure password,                              room?
   display an error
                                                   Product
       message.
                                                   Owner,
                                                   Testers,




                                                            Copyright © 2010 Quality Tree Software, Inc.
                                                 Developers,
                                                and anyone
                                                else who will
                                                  touch the
          What does                                 story.
        “secure” mean
           to you?
                            At least 6 characters with
                              at least one letter, one
                             symbol, and one number.
Capture Concrete Expectations and Examples
Password             Valid?                        Can be
                                                expressed as
“p@ssw0rd”           Yes                       “Given - When -
“p@s5”               No                             Then”
“passw0rd”           No




                                                                    Copyright © 2010 Quality Tree Software, Inc.
                              Given a user is creating an account
“p@ssword”           No
                              When they specify an insecure
“@#$%1234”           No       password
        Or can be             Then they see a message,
    expressed in tables       “Passwords must be at least 6
                              characters long with at least one
   Or in other formats        letter, one number, and one
    depending on the          symbol.”
       Framework
Why ATDD?
Reason #1:
Drive Out Ambiguity
and Clarify
Expectations
This is not an Argument about a Bug
                    “Bug Triage Meeting”
                The Tuesday before release.

 It’s a bug.




                                                            Copyright © 2010 Quality Tree Software, Inc.
 No it’s not.
                                        Whether or not
                                        it’s a bug, if we
   Is too.                              make a change
                                         we’ll blow the
   IS NOT.                                  schedule.

  IS TOO!

NOT NOT NOT!
Acceptance Tests Define Scope




Copyright © 2010 Quality Tree Software, Inc.
A Short Digression on
ATDD-Friendly Tools
Examples of ATDD-Friendly Frameworks

• Cucumber: a Ruby-based BDD tool that
  supports “Given-When-Then”
• Fitnesse: a table-driven framework that
  uses a wiki for displaying and editing




                                            Copyright © 2010 Quality Tree Software, Inc.
  tests
• Robot Framework: keyword-driven
  framework that supports text or tables
• Concordion: Java-based framework for
  expressing expectations in prose
Frameworks, Interfaces, and Drivers
   Created in      Code written during
 collaboration.      development in a      GUI Driver
Format defined    programming language   (e.g. SeleniumRC)
     by the         determined by the
  framework            framework.




                                                             Copyright © 2010 Quality Tree Software, Inc.
                                               GUI

                                           Public API
                          Test
   Natural                                   “Guts”
                        “Fixture”
  Language
 Expectations                                 Other
                                           interfaces

                                         Implementation
Characteristics of ATDD-Friendly Frameworks
•  Support expressing expectations in a language
   and format that fits the context
•  Support collaboration among the whole team
   including developers, testers, & the product owner




                                                           Copyright © 2010 Quality Tree Software, Inc.
•  Connect expectations to the system under test
   with a minimum of test code (“fixtures,” “libraries,”
   “steps”) to leverage expectations as executable
   requirements
•  Play nicely with source control systems and
   continuous integration
•  Pluggable to support a variety of interfaces
Contrasting View: Traditional Test Automation

         GUI             Automated Test
                            Scripts:
      Public API         Combination of
        “Guts”          business-facing




                                                Copyright © 2010 Quality Tree Software, Inc.
                        expectations and
         Other           implementation
      interfaces            details.

    Implementation
                         Written or recorded
                            after the fact.
                          Expectations are
                           translated, not
                              leveraged.
Back to the Example…
Take the Acceptance Tests…
Password             Valid?
“p@ssw0rd”           Yes
“p@s5”               No
“passw0rd”           No




                                                                    Copyright © 2010 Quality Tree Software, Inc.
                              Given a user is creating an account
“p@ssword”           No
                              When they specify an insecure
“@#$%1234”           No       password

     (Note that these         Then they see a message,
     expectations are         “Passwords must be at least 6
 implementation-agnostic      characters long with at least one
   and express just the       letter, one number, and one
      essence of the          symbol.”
       expectation.)
…and Write the Code


Password     Valid?       Test               GUI
“p@ssw0rd”   Yes        “Fixture”
“p@s5”       No                           Public API




                                                         Copyright © 2010 Quality Tree Software, Inc.
“passw0rd”   No
                                            “Guts”
“p@ssword”   No
“@#$%1234”   No                              Other
                                          interfaces

                                        Implementation
Why ATDD?
Reason #2:
Make progress visible.
Are We There Yet?




Copyright © 2010 Quality Tree Software, Inc.
Why ATDD?
Reason #3:
Leverage, Efficiency,
and Executable
Specifications
Traditional Approaches


                       Requirements
                       Management
                          System




                                                   Copyright © 2010 Quality Tree Software, Inc.
                       Traceability
                         Matrix
                                         Test
  Technical                           Management
Specifications              ?           System
Efficiency, Reusability, Maintainability
                        Implementation
   The tests                                 New interface?
                        change? Make a
   define the                                Just add a test
                      localized update to
 requirements.                                  fixture
                        the test fixture.




                                                                 Copyright © 2010 Quality Tree Software, Inc.
   Natural                 Test
                         “Fixture”                  …
  Language
 Expectations
                                              New Interface

                                             Implementation


 (No reconciling        (Preserve valid     (Leverage relevant
multiple, duplicate     expectations.)        expectations.)
   artifacts.)
How does ATDD fit with
the rest of the process?
ATDD: Part of an Agile Testing Strategy


                    Support                  Critique

Business-




                                                               Copyright © 2010 Quality Tree Software, Inc.
   facing      Acceptance Tests        Exploratory Testing



   Code-                              Reviews, inspections,
   facing          Unit Tests              pairing, code
                                          quality metrics


   (A variation on Brian Marick’s Agile Testing Quadrants as
        published in his essay “Agile Testing Directions”)
Tests are Versioned with the Code
           Source Control

            Natural
           Language
          Expectations




                                    Copyright © 2010 Quality Tree Software, Inc.
                 Test
               “Fixture”
                 Code
         Unit Tests

               Production
                  Code
Tests Execute as Part of the Automated Build

                     Continuous Integration




                                                              Copyright © 2010 Quality Tree Software, Inc.
   Images courtesy Mike Clark, www.pragmaticautomation.com.
   Used with permission.
Why ATDD?
Reason #4:
No more bugs. (No, I’m
not kidding. But yes,
there is a catch.)
Zero Tolerance for Bugs




                                           Copyright © 2010 Quality Tree Software, Inc.
!"#$%"%&'%(                  !"#$%"%&'%(
   )'*+,                        )'*+,
But Not Everything is a Bug

                      In this context,
                           a BUG
                     is behavior that
                    violates the letter




                                                   Copyright © 2010 Quality Tree Software, Inc.
                      or spirit of the
                     Product Owner’s
                  expectations for the
                   implemented story.

 If the behavior does not violate expectations
related to the implemented stories, it’s an item
                for the backlog.
Given all that…
Why not ATDD?
Resources
Adzic, Gojko (2009). Bridging the Communication Gap:
   Specification by Example and Agile Acceptance Testing.
   Neuri Limited.
Crispin, Lisa (2005). “Using Customer Tests to Drive
   Development.” Methods & Tools. Summer 2005 Issue.




                                                                Copyright © 2010 Quality Tree Software, Inc.
   Available online at http://www.methodsandtools.com/
   archive/archive.php?id=23
Crispin, L., & Gregory, J. (2009). Agile Testing: A Practical
   Guide for Testers and Agile Teams (Addison-Wesley
   Signature Series (Cohn)). New York: Addison-wesley
   Professional.
Marick, Brian (2003). “Agile Testing Directions.” (An
   explanation of business-facing v. code- facing tests.)
   Available online at http://www.exampler.com/old-blog/
   2003/08/22/#agile- testing-project-2
1 von 35

Recomendados

ATDD in Practice von
ATDD in PracticeATDD in Practice
ATDD in PracticeSteven Mak
21.8K views36 Folien
Automated Testing vs Manual Testing von
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual TestingDirecti Group
33.4K views24 Folien
ATDD - Acceptance Test Driven Development von
ATDD - Acceptance Test Driven DevelopmentATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven DevelopmentNaresh Jain
52K views179 Folien
Test Driven Development (TDD) von
Test Driven Development (TDD)Test Driven Development (TDD)
Test Driven Development (TDD)David Ehringer
31.9K views40 Folien
Test Process Maturity Measurement and Related Measurements von
Test Process Maturity Measurement and Related MeasurementsTest Process Maturity Measurement and Related Measurements
Test Process Maturity Measurement and Related MeasurementsSTAG Software Private Limited
3.2K views26 Folien
Cucumber BDD von
Cucumber BDDCucumber BDD
Cucumber BDDPravin Dsilva
2.6K views30 Folien

Más contenido relacionado

Was ist angesagt?

Automation test framework with cucumber – BDD von
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD123abcda
1.1K views17 Folien
Test Driven Development von
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentSachithra Gayan
1.8K views15 Folien
Introduction to Bdd and cucumber von
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumberNibu Baby
3K views26 Folien
ALM - Testes Exploratórios von
ALM - Testes ExploratóriosALM - Testes Exploratórios
ALM - Testes ExploratóriosAlan Carlos
3.8K views53 Folien
Exploratory test von
Exploratory testExploratory test
Exploratory testGitte Ottosen
3.6K views29 Folien
Exploratory testing workshop von
Exploratory testing workshopExploratory testing workshop
Exploratory testing workshopAnne-Marie Charrett
2.6K views19 Folien

Was ist angesagt?(20)

Automation test framework with cucumber – BDD von 123abcda
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
123abcda1.1K views
Introduction to Bdd and cucumber von Nibu Baby
Introduction to Bdd and cucumberIntroduction to Bdd and cucumber
Introduction to Bdd and cucumber
Nibu Baby3K views
ALM - Testes Exploratórios von Alan Carlos
ALM - Testes ExploratóriosALM - Testes Exploratórios
ALM - Testes Exploratórios
Alan Carlos3.8K views
Introduction to Extreme Programming von Naresh Jain
Introduction to Extreme ProgrammingIntroduction to Extreme Programming
Introduction to Extreme Programming
Naresh Jain10.8K views
소프트웨어 테스팅 von 영기 김
소프트웨어 테스팅소프트웨어 테스팅
소프트웨어 테스팅
영기 김29.8K views
Mutation Testing von ESUG
Mutation TestingMutation Testing
Mutation Testing
ESUG10K views
소프트웨어 공학의 사실과 오해 von 한 경만
소프트웨어 공학의 사실과 오해소프트웨어 공학의 사실과 오해
소프트웨어 공학의 사실과 오해
한 경만99 views
BDD with Cucumber von Knoldus Inc.
BDD with CucumberBDD with Cucumber
BDD with Cucumber
Knoldus Inc.15.8K views
Planning Poker von vineet
Planning PokerPlanning Poker
Planning Poker
vineet7.3K views
Definition of Done and Product Backlog refinement von Christian Vos
Definition of Done and Product Backlog refinementDefinition of Done and Product Backlog refinement
Definition of Done and Product Backlog refinement
Christian Vos3.9K views
Agile QA presentation von Carl Bruiners
Agile QA presentationAgile QA presentation
Agile QA presentation
Carl Bruiners15.4K views
What is Shift Left Testing.pdf von Testbytes
What is Shift Left Testing.pdfWhat is Shift Left Testing.pdf
What is Shift Left Testing.pdf
Testbytes481 views
Py.test von soasme
Py.testPy.test
Py.test
soasme6.7K views

Destacado

Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve... von
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
16.3K views41 Folien
TDD - Agile von
TDD - Agile TDD - Agile
TDD - Agile harinderpisces
8.6K views21 Folien
On the Care and Feeding of Feedback Cycles von
On the Care and Feeding of Feedback CyclesOn the Care and Feeding of Feedback Cycles
On the Care and Feeding of Feedback CyclesElisabeth Hendrickson
4.4K views20 Folien
Agile Testing Overview von
Agile Testing OverviewAgile Testing Overview
Agile Testing OverviewElisabeth Hendrickson
2.4K views21 Folien
The Thinking Tester, Evolved von
The Thinking Tester, EvolvedThe Thinking Tester, Evolved
The Thinking Tester, EvolvedElisabeth Hendrickson
7.5K views17 Folien
Exploratory Testing in an Agile Context von
Exploratory Testing in an Agile ContextExploratory Testing in an Agile Context
Exploratory Testing in an Agile ContextElisabeth Hendrickson
4.4K views48 Folien

Destacado(20)

Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve... von Zohirul Alam Tiemoon
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Zohirul Alam Tiemoon16.3K views
Acceptance test driven development (attd) cycle von Giuseppe Torchia
Acceptance test driven development (attd) cycleAcceptance test driven development (attd) cycle
Acceptance test driven development (attd) cycle
Giuseppe Torchia2.2K views
Acceptance Test Driven Development With Spec Flow And Friends von Christopher Bartling
Acceptance Test Driven Development With Spec Flow And FriendsAcceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And Friends
Writing Good User Stories (Hint: It's not about writing) von one80
Writing Good User Stories (Hint: It's not about writing)Writing Good User Stories (Hint: It's not about writing)
Writing Good User Stories (Hint: It's not about writing)
one802.2K views
TDD vs. ATDD - What, Why, Which, When & Where von Daniel Davis
TDD vs. ATDD - What, Why, Which, When & WhereTDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & Where
Daniel Davis3.4K views
Agile Test Driven Development von Viraf Karai
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven Development
Viraf Karai15K views

Similar a Introduction to Acceptance Test Driven Development

Agile: Get Real von
Agile: Get RealAgile: Get Real
Agile: Get RealElisabeth Hendrickson
937 views20 Folien
Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs... von
Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...
Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...André Goliath
653 views68 Folien
Creating Realistic User Experiences with Interactive Prototypes von
Creating Realistic User Experiences with Interactive PrototypesCreating Realistic User Experiences with Interactive Prototypes
Creating Realistic User Experiences with Interactive PrototypesPerficient, Inc.
709 views30 Folien
Azure Meetup: Novità CosmosDB modalità Serverless e Cognitive Services von
Azure Meetup: Novità CosmosDB modalità Serverless e Cognitive ServicesAzure Meetup: Novità CosmosDB modalità Serverless e Cognitive Services
Azure Meetup: Novità CosmosDB modalità Serverless e Cognitive Servicesdotnetcode
67 views28 Folien
Install Offline Client for Oracle CRM on Demand von
Install Offline Client for Oracle CRM on DemandInstall Offline Client for Oracle CRM on Demand
Install Offline Client for Oracle CRM on DemandDaniel Jordan
464 views12 Folien
Crm gadget 2 go install von
Crm gadget 2 go installCrm gadget 2 go install
Crm gadget 2 go installDaniel Jordan
384 views12 Folien

Similar a Introduction to Acceptance Test Driven Development(20)

Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs... von André Goliath
Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...
Von JavaEE auf Microservice in 6 Monaten - The Good, the Bad, and the wtfs...
André Goliath653 views
Creating Realistic User Experiences with Interactive Prototypes von Perficient, Inc.
Creating Realistic User Experiences with Interactive PrototypesCreating Realistic User Experiences with Interactive Prototypes
Creating Realistic User Experiences with Interactive Prototypes
Perficient, Inc.709 views
Azure Meetup: Novità CosmosDB modalità Serverless e Cognitive Services von dotnetcode
Azure Meetup: Novità CosmosDB modalità Serverless e Cognitive ServicesAzure Meetup: Novità CosmosDB modalità Serverless e Cognitive Services
Azure Meetup: Novità CosmosDB modalità Serverless e Cognitive Services
dotnetcode67 views
Install Offline Client for Oracle CRM on Demand von Daniel Jordan
Install Offline Client for Oracle CRM on DemandInstall Offline Client for Oracle CRM on Demand
Install Offline Client for Oracle CRM on Demand
Daniel Jordan464 views
CloudBees - Sacha Labourey - May 2011 von JUG Lausanne
CloudBees - Sacha Labourey - May 2011CloudBees - Sacha Labourey - May 2011
CloudBees - Sacha Labourey - May 2011
JUG Lausanne825 views
Open Sourcing the User Experience for the IoT von AllSeen Alliance
Open Sourcing the User Experience for the IoTOpen Sourcing the User Experience for the IoT
Open Sourcing the User Experience for the IoT
AllSeen Alliance699 views
Microsoft Cognitive Services & Bot Framework - Universidade Fernando Pessoa von Rui Quintino
Microsoft Cognitive Services & Bot Framework - Universidade Fernando PessoaMicrosoft Cognitive Services & Bot Framework - Universidade Fernando Pessoa
Microsoft Cognitive Services & Bot Framework - Universidade Fernando Pessoa
Rui Quintino491 views
Make the Cloud Less Cloudy: A Perspective for Software Development Teams von TechWell
Make the Cloud Less Cloudy: A Perspective for Software Development TeamsMake the Cloud Less Cloudy: A Perspective for Software Development Teams
Make the Cloud Less Cloudy: A Perspective for Software Development Teams
TechWell498 views
Spare clive grinyer von lightningUX
Spare   clive grinyerSpare   clive grinyer
Spare clive grinyer
lightningUX270 views
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap von Day Software
David Nuescheler: Igniting CQ 5.3: What's New and RoadmapDavid Nuescheler: Igniting CQ 5.3: What's New and Roadmap
David Nuescheler: Igniting CQ 5.3: What's New and Roadmap
Day Software577 views
A Gentle Intro to Deep Learning von Gabe Hollombe
A Gentle Intro to Deep LearningA Gentle Intro to Deep Learning
A Gentle Intro to Deep Learning
Gabe Hollombe108 views
Scalable code Design with slimmer Django models .. and more von Dawa Sherpa
Scalable code  Design with slimmer Django models .. and moreScalable code  Design with slimmer Django models .. and more
Scalable code Design with slimmer Django models .. and more
Dawa Sherpa508 views
[REPEAT 1] Architecting Security & Governance across your AWS Landing Zone (S... von Amazon Web Services
[REPEAT 1] Architecting Security & Governance across your AWS Landing Zone (S...[REPEAT 1] Architecting Security & Governance across your AWS Landing Zone (S...
[REPEAT 1] Architecting Security & Governance across your AWS Landing Zone (S...
Amazon Web Services2.8K views
Application Logging for fun and profit. Houston TechFest 2012 von Jane Prusakova
Application Logging for fun and profit.  Houston TechFest 2012Application Logging for fun and profit.  Houston TechFest 2012
Application Logging for fun and profit. Houston TechFest 2012
Jane Prusakova393 views
Elisa cloud announcement von Pasi Maenpaa
Elisa cloud announcementElisa cloud announcement
Elisa cloud announcement
Pasi Maenpaa425 views

Más de Elisabeth Hendrickson

Influence > Authority von
Influence > AuthorityInfluence > Authority
Influence > AuthorityElisabeth Hendrickson
295 views20 Folien
Agility for Data von
Agility for DataAgility for Data
Agility for DataElisabeth Hendrickson
613 views29 Folien
#LFMF: Tales of Test Automation Gone Wrong von
#LFMF: Tales of Test Automation Gone Wrong #LFMF: Tales of Test Automation Gone Wrong
#LFMF: Tales of Test Automation Gone Wrong Elisabeth Hendrickson
2.3K views27 Folien
AGILEEE Friday 17:15 Talk von
AGILEEE Friday 17:15 TalkAGILEEE Friday 17:15 Talk
AGILEEE Friday 17:15 TalkElisabeth Hendrickson
1.1K views37 Folien
Entaggle: an Agile Software Development Case Study von
Entaggle: an Agile Software Development Case StudyEntaggle: an Agile Software Development Case Study
Entaggle: an Agile Software Development Case StudyElisabeth Hendrickson
1.1K views15 Folien
Wclessons atd-sm von
Wclessons atd-smWclessons atd-sm
Wclessons atd-smElisabeth Hendrickson
1.2K views32 Folien

Último

Classification of crude drugs.pptx von
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptxGayatriPatra14
86 views13 Folien
Narration ppt.pptx von
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptxTARIQ KHAN
135 views24 Folien
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptx von
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxGopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxDebapriya Chakraborty
655 views81 Folien
Dance KS5 Breakdown von
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 BreakdownWestHatch
79 views2 Folien
Solar System and Galaxies.pptx von
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptxDrHafizKosar
91 views26 Folien
AI Tools for Business and Startups von
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and StartupsSvetlin Nakov
107 views39 Folien

Último(20)

Classification of crude drugs.pptx von GayatriPatra14
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptx
GayatriPatra1486 views
Narration ppt.pptx von TARIQ KHAN
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptx
TARIQ KHAN135 views
Dance KS5 Breakdown von WestHatch
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 Breakdown
WestHatch79 views
Solar System and Galaxies.pptx von DrHafizKosar
Solar System and Galaxies.pptxSolar System and Galaxies.pptx
Solar System and Galaxies.pptx
DrHafizKosar91 views
AI Tools for Business and Startups von Svetlin Nakov
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov107 views
11.30.23 Poverty and Inequality in America.pptx von mary850239
11.30.23 Poverty and Inequality in America.pptx11.30.23 Poverty and Inequality in America.pptx
11.30.23 Poverty and Inequality in America.pptx
mary850239160 views
Use of Probiotics in Aquaculture.pptx von AKSHAY MANDAL
Use of Probiotics in Aquaculture.pptxUse of Probiotics in Aquaculture.pptx
Use of Probiotics in Aquaculture.pptx
AKSHAY MANDAL100 views
Community-led Open Access Publishing webinar.pptx von Jisc
Community-led Open Access Publishing webinar.pptxCommunity-led Open Access Publishing webinar.pptx
Community-led Open Access Publishing webinar.pptx
Jisc93 views
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively von PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 585 views
Ch. 7 Political Participation and Elections.pptx von Rommel Regala
Ch. 7 Political Participation and Elections.pptxCh. 7 Political Participation and Elections.pptx
Ch. 7 Political Participation and Elections.pptx
Rommel Regala97 views
JiscOAWeek_LAIR_slides_October2023.pptx von Jisc
JiscOAWeek_LAIR_slides_October2023.pptxJiscOAWeek_LAIR_slides_October2023.pptx
JiscOAWeek_LAIR_slides_October2023.pptx
Jisc96 views
The Accursed House by Émile Gaboriau von DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta201 views
Psychology KS5 von WestHatch
Psychology KS5Psychology KS5
Psychology KS5
WestHatch93 views
The basics - information, data, technology and systems.pdf von JonathanCovena1
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdf
JonathanCovena1115 views

Introduction to Acceptance Test Driven Development

  • 1. Beginning with the End in Mind: Driving Development with Acceptance Tests Elisabeth Hendrickson Quality Tree Software, Inc. www.qualitytree.com esh@qualitytree.com Last updated November 10, 2009 This work is licensed under the Creative Commons Attribution 3.0 United States License. View a copy of this license.
  • 3. Acceptance-Test Driven Development (ATDD) Cycle 0&1(/.2 3,.4#15 -21&6 -21&6 -21&6 -21&6 -21&6 Copyright © 2010 Quality Tree Software, Inc. 0&1(/.2 !$-./-- '" ( * + #" , ) &" " * !"#$%"& !"%"#17 (Model developed with Pekka Klärck, Bas Vodde, and Craig Larman.)
  • 4. ATDD: Discuss !"#$%&' ()&*+#, !"#$%& Copyright © 2010 Quality Tree Software, Inc. '(&%$)*#(&+(, -'#". -'#". -'#". -'#". Concrete Examples with -'#". Expectations (Slide developed in collaboration with Pekka Klärck.)
  • 5. ATDD: Develop '*&+%","-."/,/ Copyright © 2010 Quality Tree Software, Inc. '()*+"& %#$& !"# ,-(* .&/*/ !"#$ & ' (" ) $ %" " %#$& & (Slide developed in collaboration with Pekka Klärck.)
  • 6. ATDD: Deliver Copyright © 2010 Quality Tree Software, Inc. Product Feature Feature Feature Feature Feature Feature FeatureFeature Feature (Slide developed in collaboration with Pekka Klärck.)
  • 8. Start with the Story As an administrator, I want users creating accounts to be required Copyright © 2010 Quality Tree Software, Inc. to choose secure passwords so that their accounts cannot be hacked by someone using a password guessing program.
  • 9. Discuss And if a user provides Who’s in the an insecure password, room? display an error Product message. Owner, Testers, Copyright © 2010 Quality Tree Software, Inc. Developers, and anyone else who will touch the What does story. “secure” mean to you? At least 6 characters with at least one letter, one symbol, and one number.
  • 10. Capture Concrete Expectations and Examples Password Valid? Can be expressed as “p@ssw0rd” Yes “Given - When - “p@s5” No Then” “passw0rd” No Copyright © 2010 Quality Tree Software, Inc. Given a user is creating an account “p@ssword” No When they specify an insecure “@#$%1234” No password Or can be Then they see a message, expressed in tables “Passwords must be at least 6 characters long with at least one Or in other formats letter, one number, and one depending on the symbol.” Framework
  • 11. Why ATDD? Reason #1: Drive Out Ambiguity and Clarify Expectations
  • 12. This is not an Argument about a Bug “Bug Triage Meeting” The Tuesday before release. It’s a bug. Copyright © 2010 Quality Tree Software, Inc. No it’s not. Whether or not it’s a bug, if we Is too. make a change we’ll blow the IS NOT. schedule. IS TOO! NOT NOT NOT!
  • 13. Acceptance Tests Define Scope Copyright © 2010 Quality Tree Software, Inc.
  • 14. A Short Digression on ATDD-Friendly Tools
  • 15. Examples of ATDD-Friendly Frameworks • Cucumber: a Ruby-based BDD tool that supports “Given-When-Then” • Fitnesse: a table-driven framework that uses a wiki for displaying and editing Copyright © 2010 Quality Tree Software, Inc. tests • Robot Framework: keyword-driven framework that supports text or tables • Concordion: Java-based framework for expressing expectations in prose
  • 16. Frameworks, Interfaces, and Drivers Created in Code written during collaboration. development in a GUI Driver Format defined programming language (e.g. SeleniumRC) by the determined by the framework framework. Copyright © 2010 Quality Tree Software, Inc. GUI Public API Test Natural “Guts” “Fixture” Language Expectations Other interfaces Implementation
  • 17. Characteristics of ATDD-Friendly Frameworks •  Support expressing expectations in a language and format that fits the context •  Support collaboration among the whole team including developers, testers, & the product owner Copyright © 2010 Quality Tree Software, Inc. •  Connect expectations to the system under test with a minimum of test code (“fixtures,” “libraries,” “steps”) to leverage expectations as executable requirements •  Play nicely with source control systems and continuous integration •  Pluggable to support a variety of interfaces
  • 18. Contrasting View: Traditional Test Automation GUI Automated Test Scripts: Public API Combination of “Guts” business-facing Copyright © 2010 Quality Tree Software, Inc. expectations and Other implementation interfaces details. Implementation Written or recorded after the fact. Expectations are translated, not leveraged.
  • 19. Back to the Example…
  • 20. Take the Acceptance Tests… Password Valid? “p@ssw0rd” Yes “p@s5” No “passw0rd” No Copyright © 2010 Quality Tree Software, Inc. Given a user is creating an account “p@ssword” No When they specify an insecure “@#$%1234” No password (Note that these Then they see a message, expectations are “Passwords must be at least 6 implementation-agnostic characters long with at least one and express just the letter, one number, and one essence of the symbol.” expectation.)
  • 21. …and Write the Code Password Valid? Test GUI “p@ssw0rd” Yes “Fixture” “p@s5” No Public API Copyright © 2010 Quality Tree Software, Inc. “passw0rd” No “Guts” “p@ssword” No “@#$%1234” No Other interfaces Implementation
  • 22. Why ATDD? Reason #2: Make progress visible.
  • 23. Are We There Yet? Copyright © 2010 Quality Tree Software, Inc.
  • 24. Why ATDD? Reason #3: Leverage, Efficiency, and Executable Specifications
  • 25. Traditional Approaches Requirements Management System Copyright © 2010 Quality Tree Software, Inc. Traceability Matrix Test Technical Management Specifications ? System
  • 26. Efficiency, Reusability, Maintainability Implementation The tests New interface? change? Make a define the Just add a test localized update to requirements. fixture the test fixture. Copyright © 2010 Quality Tree Software, Inc. Natural Test “Fixture” … Language Expectations New Interface Implementation (No reconciling (Preserve valid (Leverage relevant multiple, duplicate expectations.) expectations.) artifacts.)
  • 27. How does ATDD fit with the rest of the process?
  • 28. ATDD: Part of an Agile Testing Strategy Support Critique Business- Copyright © 2010 Quality Tree Software, Inc. facing Acceptance Tests Exploratory Testing Code- Reviews, inspections, facing Unit Tests pairing, code quality metrics (A variation on Brian Marick’s Agile Testing Quadrants as published in his essay “Agile Testing Directions”)
  • 29. Tests are Versioned with the Code Source Control Natural Language Expectations Copyright © 2010 Quality Tree Software, Inc. Test “Fixture” Code Unit Tests Production Code
  • 30. Tests Execute as Part of the Automated Build Continuous Integration Copyright © 2010 Quality Tree Software, Inc. Images courtesy Mike Clark, www.pragmaticautomation.com. Used with permission.
  • 31. Why ATDD? Reason #4: No more bugs. (No, I’m not kidding. But yes, there is a catch.)
  • 32. Zero Tolerance for Bugs Copyright © 2010 Quality Tree Software, Inc. !"#$%"%&'%( !"#$%"%&'%( )'*+, )'*+,
  • 33. But Not Everything is a Bug In this context, a BUG is behavior that violates the letter Copyright © 2010 Quality Tree Software, Inc. or spirit of the Product Owner’s expectations for the implemented story. If the behavior does not violate expectations related to the implemented stories, it’s an item for the backlog.
  • 35. Resources Adzic, Gojko (2009). Bridging the Communication Gap: Specification by Example and Agile Acceptance Testing. Neuri Limited. Crispin, Lisa (2005). “Using Customer Tests to Drive Development.” Methods & Tools. Summer 2005 Issue. Copyright © 2010 Quality Tree Software, Inc. Available online at http://www.methodsandtools.com/ archive/archive.php?id=23 Crispin, L., & Gregory, J. (2009). Agile Testing: A Practical Guide for Testers and Agile Teams (Addison-Wesley Signature Series (Cohn)). New York: Addison-wesley Professional. Marick, Brian (2003). “Agile Testing Directions.” (An explanation of business-facing v. code- facing tests.) Available online at http://www.exampler.com/old-blog/ 2003/08/22/#agile- testing-project-2