SlideShare a Scribd company logo
Patterns for Scripted
Acceptance Test-Driven
    Development
         Fang Liu
        Ider Zheng
        Pooja Gore




            1
Intent



 Patterns for acceptance test-driven development
  (ATDD) using scripts

 Approaches to cope with the challenges




                          2
Context


ATDD consists of

 Script Languages
  o Allows control of one or more application

 Business objects
  o manipulated by the program which make sense to the client
  o hidden to the client

 Non-Business Objects

                               3
Problem



 Client must understand and review the tests
  o Should be imbued with a testing culture
  o A learning curve is associated with the approach




                             4
Interrelated Patterns
Test Creation Patterns

Test Flow    Creator   Destroyer


 Limit      Command      Table
Breaker       Errors     Tester

Workflow    Template   Persistence
 Tester      Tester      Tester
Test Flow



 To verify if a given software property results as
  expected after a given action
Three Steps for Test Flow


 Step 1:
  o Build a scenario you want to test

 Step 2:
  o Operate the program with the desired action

 Step 3:
  o Check the new program’s state.
Creator & Destroyer



 To test if a business object has been successfully
  created or removed in the program

 Business object creation and destruction are common
  operations in test scripts
Steps for Construction

  Check
Object Not   •Otherwise, exception
              or do nothing

  Exist


               Create
               Object



                                       Check         •Otherwise, exception
                                                      or go back creation
                                     Object Exist     step




                                                    Validate the
                                                    property of
                                                      Object
Steps for Destruction

  Check        •Otherwise, do
                nothing
Object Exist



                Destroy
                Object


                                  Check       •Otherwise, exception
                                Object Not     or go back destroy
                                               step
                                  Exist

                                              Validate
                                               double
                                             Destruction
Limit Breaker



 To test a business object or program flow that has
  limits (ranges or sets of allowed values)
Limit Breaker

 Always precisely demarcate limits by giving examples of
  inner and outer bounds.

 Make sure values immediately out of the bounds throw
  errors, and limit inbound values don't.

 In general, tests for the immediate limits are enough to
  indicate to the developer that further values aren’t
  acceptable, even if the tests don’t explicitly list all of them.
Command Errors



 Created a new command to incorporate in the script
  language and will start writing tests with it
Command Errors

 Test coverage is difficult to attain if you don’t approach testing
  systematically

 When thinking on a new command to add to the script
  language, you often think about tests that will involve this
  command, including anomalous uses;

 A system should be able to identify a misuse of one of its
  operations and may even give clues about the problem cause
Table Tester



 To test extensive lists of features for multiple business objects
  of the same kind, or multiple examples to test formulas
  (calculations)

 To declare business rules in a formulaic manner
Table Tester
Workflow Tester

 Context
        Test a workflow

 Problem
  o Tables become too verbose
  o Such tables make script understanding and maintenance difficult

 Forces
        A workflow is sequential in nature

 Solution
        Use commands in sequence instead of tables
Template Tester

 Context
        Testing massive textual or non-textual content
 Problem
  o Massive textual content makes a script unintelligible
  o Non-textual content can only be included in a script through an IDE
 Forces
        Templates for test cases can be generated using software
 Solution
  o Divert the contents to be tested to outside the script
  o And use a template to compare it with

 Related Patterns
        Test Flow
Persistence Tester

 Context
        Test if data entered in the program is persistent
 Problem
        Lack of a systematic approach to testing persistence
 Forces
        Setting up a scenario for persistence can often be reused
 Solution
  o The first part, add data in a program
  o The second part , check if data is retained
 Related Patterns
        Test Flow
Test Organization Patterns


     Build     Only Business
  Summarizer     Objects



         Commentor
Build Summarizer

 Context
        Similar test used frequently in a script

 Problem
        Repetition of the same test sequence, making script verbose

 Forces
      Commonly used sequence can be summarized in an expressive
  command

 Solution
        Set commonly used tests a separate single test sequence
Only Business Objects

 Context
        Tests include Non-business objects

 Problem
        Tests for non-business objects are unintelligible for the client

 Forces
  o Client’s understanding of all Tests is important
  o Testing non-business objects is equally important

 Solution
  o Test only business objects in an acceptance test script
  o Test all Non-Business Objects with Unit Test
Commentor

 Context
        Developer fails to understand a designed test

 Problem
  o Development stalls
  o A bug or wrong requirement may be introduced
  o Inconsistent Test Comments

 Forces
        Communicator between Client and Developer

 Solution
  o Use Comments
  o Update Comments
Test Application Patterns




 Client        Template
Assertion     Generator
Client Assertion

 Context
  o Find a potential wrong test
 Problem
  o If bugs are changed by developers, feature creep will emerge
  o If bugs are not found, clients disappointed
 Forces
  o Clients must review tests
 Solutions
   No test should be modified without the client’s consent


                                27
Template Generator


 Context

 Problem
  o Becomes harder to find test cases

 Solution
   Exam the presented results


                            28
Testing tools


 Most widely known
  o FIT (Framework for Integrated Testing)


 Others
  o EasyAccept
  o Exactor
THANK YOU!

    30

More Related Content

PDF
An Introduction to Test Driven Development
PPTX
TDD - Agile
PPTX
Test-Driven Development
PDF
Test Driven Development
PDF
TDD Flow: The Mantra in Action
KEY
Introduction to Acceptance Test Driven Development
PDF
Test Driven Development (TDD)
PPSX
Unit Test Presentation
An Introduction to Test Driven Development
TDD - Agile
Test-Driven Development
Test Driven Development
TDD Flow: The Mantra in Action
Introduction to Acceptance Test Driven Development
Test Driven Development (TDD)
Unit Test Presentation

What's hot (18)

PPS
Why Unit Testingl
PDF
Unit Testing Guidelines
PPTX
Unit Testing
PDF
Software Testing
PPS
Unit Testing
PPTX
Software testing ... who’s responsible is it?
PPT
TDD (Test Driven Design)
PPTX
Test Driven Development (TDD) Preso 360|Flex 2010
PPTX
Unit tests & TDD
PPTX
UNIT TESTING
PPTX
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
PPTX
Unit Testing And Mocking
PPTX
Agile and ATDD the perfect couple
PPTX
Benefit From Unit Testing In The Real World
PPTX
Unit testing
PDF
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
PPTX
Understanding Unit Testing
PPTX
Unit test
Why Unit Testingl
Unit Testing Guidelines
Unit Testing
Software Testing
Unit Testing
Software testing ... who’s responsible is it?
TDD (Test Driven Design)
Test Driven Development (TDD) Preso 360|Flex 2010
Unit tests & TDD
UNIT TESTING
Roy Osherove on Unit Testing Good Practices and Horrible Mistakes
Unit Testing And Mocking
Agile and ATDD the perfect couple
Benefit From Unit Testing In The Real World
Unit testing
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Understanding Unit Testing
Unit test
Ad

Similar to Patterns for Scripted Acceptance Test-Driven Development (20)

PDF
test
PDF
test
PPTX
Test Driven Development
ODP
Writing useful automated tests for the single page applications you build
PPTX
Software testing ... who is responsible for it?
PPTX
Unit Testing in Swift
PPTX
Implementing Test Automation in Agile Projects
PDF
Agile Testing 20021015
PPTX
Types of testing
PPTX
Software testing ppt
PDF
Implementing Test Automation in Agile Projects
PPT
Testing and Mocking Object - The Art of Mocking.
PDF
Keyword Driven Testing
PPTX
JavaScript Unit Testing
PPTX
Database Unit Testing Made Easy with VSTS
PDF
Tester Challenges in Agile ?
PDF
Agile process
PPTX
Making the Unstable Stable - An Intro To Testing
PPTX
Unit testing & TDD concepts with best practice guidelines.
PDF
Agile Software Development in Practice - A Developer Perspective
test
test
Test Driven Development
Writing useful automated tests for the single page applications you build
Software testing ... who is responsible for it?
Unit Testing in Swift
Implementing Test Automation in Agile Projects
Agile Testing 20021015
Types of testing
Software testing ppt
Implementing Test Automation in Agile Projects
Testing and Mocking Object - The Art of Mocking.
Keyword Driven Testing
JavaScript Unit Testing
Database Unit Testing Made Easy with VSTS
Tester Challenges in Agile ?
Agile process
Making the Unstable Stable - An Intro To Testing
Unit testing & TDD concepts with best practice guidelines.
Agile Software Development in Practice - A Developer Perspective
Ad

Recently uploaded (20)

PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
HVAC Specification 2024 according to central public works department
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
My India Quiz Book_20210205121199924.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
advance database management system book.pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Computer Architecture Input Output Memory.pptx
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Hazard Identification & Risk Assessment .pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Computing-Curriculum for Schools in Ghana
PPTX
20th Century Theater, Methods, History.pptx
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PPTX
Virtual and Augmented Reality in Current Scenario
Unit 4 Computer Architecture Multicore Processor.pptx
LDMMIA Reiki Yoga Finals Review Spring Summer
HVAC Specification 2024 according to central public works department
Practical Manual AGRO-233 Principles and Practices of Natural Farming
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
History, Philosophy and sociology of education (1).pptx
My India Quiz Book_20210205121199924.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
advance database management system book.pdf
Chinmaya Tiranga quiz Grand Finale.pdf
Computer Architecture Input Output Memory.pptx
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Hazard Identification & Risk Assessment .pdf
What if we spent less time fighting change, and more time building what’s rig...
Computing-Curriculum for Schools in Ghana
20th Century Theater, Methods, History.pptx
FORM 1 BIOLOGY MIND MAPS and their schemes
Virtual and Augmented Reality in Current Scenario

Patterns for Scripted Acceptance Test-Driven Development

  • 1. Patterns for Scripted Acceptance Test-Driven Development Fang Liu Ider Zheng Pooja Gore 1
  • 2. Intent  Patterns for acceptance test-driven development (ATDD) using scripts  Approaches to cope with the challenges 2
  • 3. Context ATDD consists of  Script Languages o Allows control of one or more application  Business objects o manipulated by the program which make sense to the client o hidden to the client  Non-Business Objects 3
  • 4. Problem  Client must understand and review the tests o Should be imbued with a testing culture o A learning curve is associated with the approach 4
  • 6. Test Creation Patterns Test Flow Creator Destroyer Limit Command Table Breaker Errors Tester Workflow Template Persistence Tester Tester Tester
  • 7. Test Flow  To verify if a given software property results as expected after a given action
  • 8. Three Steps for Test Flow  Step 1: o Build a scenario you want to test  Step 2: o Operate the program with the desired action  Step 3: o Check the new program’s state.
  • 9. Creator & Destroyer  To test if a business object has been successfully created or removed in the program  Business object creation and destruction are common operations in test scripts
  • 10. Steps for Construction Check Object Not •Otherwise, exception or do nothing Exist Create Object Check •Otherwise, exception or go back creation Object Exist step Validate the property of Object
  • 11. Steps for Destruction Check •Otherwise, do nothing Object Exist Destroy Object Check •Otherwise, exception Object Not or go back destroy step Exist Validate double Destruction
  • 12. Limit Breaker  To test a business object or program flow that has limits (ranges or sets of allowed values)
  • 13. Limit Breaker  Always precisely demarcate limits by giving examples of inner and outer bounds.  Make sure values immediately out of the bounds throw errors, and limit inbound values don't.  In general, tests for the immediate limits are enough to indicate to the developer that further values aren’t acceptable, even if the tests don’t explicitly list all of them.
  • 14. Command Errors  Created a new command to incorporate in the script language and will start writing tests with it
  • 15. Command Errors  Test coverage is difficult to attain if you don’t approach testing systematically  When thinking on a new command to add to the script language, you often think about tests that will involve this command, including anomalous uses;  A system should be able to identify a misuse of one of its operations and may even give clues about the problem cause
  • 16. Table Tester  To test extensive lists of features for multiple business objects of the same kind, or multiple examples to test formulas (calculations)  To declare business rules in a formulaic manner
  • 18. Workflow Tester  Context Test a workflow  Problem o Tables become too verbose o Such tables make script understanding and maintenance difficult  Forces A workflow is sequential in nature  Solution Use commands in sequence instead of tables
  • 19. Template Tester  Context Testing massive textual or non-textual content  Problem o Massive textual content makes a script unintelligible o Non-textual content can only be included in a script through an IDE  Forces Templates for test cases can be generated using software  Solution o Divert the contents to be tested to outside the script o And use a template to compare it with  Related Patterns Test Flow
  • 20. Persistence Tester  Context Test if data entered in the program is persistent  Problem Lack of a systematic approach to testing persistence  Forces Setting up a scenario for persistence can often be reused  Solution o The first part, add data in a program o The second part , check if data is retained  Related Patterns Test Flow
  • 21. Test Organization Patterns Build Only Business Summarizer Objects Commentor
  • 22. Build Summarizer  Context Similar test used frequently in a script  Problem Repetition of the same test sequence, making script verbose  Forces Commonly used sequence can be summarized in an expressive command  Solution Set commonly used tests a separate single test sequence
  • 23. Only Business Objects  Context Tests include Non-business objects  Problem Tests for non-business objects are unintelligible for the client  Forces o Client’s understanding of all Tests is important o Testing non-business objects is equally important  Solution o Test only business objects in an acceptance test script o Test all Non-Business Objects with Unit Test
  • 24. Commentor  Context Developer fails to understand a designed test  Problem o Development stalls o A bug or wrong requirement may be introduced o Inconsistent Test Comments  Forces Communicator between Client and Developer  Solution o Use Comments o Update Comments
  • 25. Test Application Patterns Client Template Assertion Generator
  • 26. Client Assertion  Context o Find a potential wrong test  Problem o If bugs are changed by developers, feature creep will emerge o If bugs are not found, clients disappointed  Forces o Clients must review tests  Solutions  No test should be modified without the client’s consent 27
  • 27. Template Generator  Context  Problem o Becomes harder to find test cases  Solution  Exam the presented results 28
  • 28. Testing tools  Most widely known o FIT (Framework for Integrated Testing)  Others o EasyAccept o Exactor

Editor's Notes

  • #20: Example:In a Monopoly game, you need to test if a player is thrown out of the game afterfalling on a series of tax places and taking a series of actions that decrease hismoney. If you use tables, you will need a separate table for every command you use.
  • #21: Example:generateReport output="report.txt"# equalFiles is a command in EasyAccept that tests if# two files have the exact same contentequalFiles templates\\reportTemplate.txt report.txt
  • #22: Example:# creating an employee - script1.txtclearEmployeeDatabaseexpecterror "employee doesn't exist" getEmployeeSalary \\employeeName="John Doe"createEmployeeemployeeName="John Doe" salary=1500expect 1500 getEmployeeSalaryemployeeName="John Doe"saveEverythingAndCloseProgram# restart is an EasyAccept commandrestart# checking persistenceexpect 1500 getEmployeeSalaryemployeeName="John Doe"
  • #24: # script 1executeScript sampleDatabaseSetup.txt… and then do the tests you want# script 2executeScript sampleDatabaseSetup.txt… and then do a number of different tests
  • #25: # the tests below should be unit testsexpect 25 getBQueueNodeFatherIndexexpectError “Code #432653: unexpected fault for the middleware connection”getCORBASkeletonMiddlwareProperty