SlideShare uma empresa Scribd logo
1 de 36
Acceptance Test Driven
Development in practice
Steven Mak
steven@odd-e.com
What are we up to now?
Lost in translation
Do not explain why
Gaps discovered only until coding started
Cumulative effects of small misunderstandings
Inadequate and essentially flawed requirements and
specifications
Failing to meet actual needs
 are obvious things really obvious?




 Imperative requirements




 Fulfilling specifications does not guarantee success
Meeting the needs with
Acceptance TDD

                   Acceptance Test              Implementation
    Requirement                      Feedback




Drive implementation of a requirement through a set of
automated, executable acceptance tests
ATDD in a Nutshell
Real-world examples to build a shared understanding of the
domain
Select a set of these examples to be a specification and an
acceptance test suite
Automate the verification of acceptance tests
Focus the software development effort on the acceptance
tests
Use the set of acceptance tests to facilitate discussion about
future change requests.
The ATDD cycle
                                                           •Implementation of tests usually
                    coding
                                                            occur before the code is done
                    testing
                                                           • Feature not done until test passes




                                             Feature
Specification architecture




                                              Done
 Workshop customer documentation
                    other activities


                                                           • Activities happen in parallel
   Developers
     Testers
                                                •Team clarifies and implement the feature
                                   Example
 Product Owner
    Architect                       tests        together
Technical writers
                                                •Tests are executable at the end of the ATDD
                                                 Workshop
Benefits of ATDD
Comprehensible examples over complex formulas
Close Collaboration
Definition of Done
Trust and Commitment
Testing on system level
Specification by Examples
Use realistic examples to demonstrate differences in
possibilities instead of abstract requirements
Write specifications down as tables
Workflows:
  Preconditions
  Processing steps
  Verifications
Examples, Tests, and Spec
             can become
 Examples                    Tests
  ela




                              rify
   bo




                            ve
     ra
        te




             Requirements
Specification workshop
Ask the domain experts
Developers and testers should suggest examples of
edges or important issues for discussion
Ubiquitous language
Organise feedback to ensure shared understanding
Use facilitator to stay focused if needed
Distilling the specifications
 Write tests collaboratively
 Examples in a form close to what your automation tool can
 understand
 Keep tests in a form that is human-readable
 Specification over Scripting, describe WHAT, not how
 Acceptance tests to prevent defects, not to discover
 Not necessarily automate anything
 Acceptance tests only work when we can discuss them
Some considerations
User Interface
  Easy?

  Fragile?

  Performance issues?

Boundary of Stub
  Sufficiently close

  Simulators?

Business logic
  Not from developer perspective
Acceptance Test smells
Long tests
Parameters of calculation tests that always have the same
value
Similar test with minor differences
Tests that reflect the way code was written
Tests fail intermittently even though you didn’t change any
code
Interdependent tests, e.g. setup for others
Change
Use existing acceptance tests to discuss future
changes
Seek advices from customer to determine if it specifies
obsolete functionality when test fails
Automate periodic execution of regression tests with CI
Keep tests in the same version control as code
Tools
Table-based frameworks
  FIT, http://fit.c2.com

  RobotFramework, http://robotframework.org

Text-based frameworks
  Exactor, http://exactor.sourceforge.net

  TextTest, http://texttest.carmen.se
FIT
 FIT stands for “Framework for Integrated Tests”
 Most popular framework in-use
 Table-based
 Supporting languages like Java, C/C++, C#, Python, or
 Ruby
 FitLibrary to extend FIT
FIT in practice
                          Test doc
                         with tables

    Customer writes a
                                       Technical staff enhance
     test document
                                        the tables in the doc
   containing examples

                                                                 Test doc with
                                                                   sanitised
                                                                    tables
                                           Technical staff
     Executable Test                     implements fixture
                                              classes

                          Test doc and
                          backing code
                           (e.g. Java)
FIT Document
Customers write acceptance tests in their own
language using their own tools.
Fixtures
 Take information from the tables and turn them into
 method calls on the actual application.
 ColumnFixture - checking rules and calculations
 ActionFixture - Step-by-step processing
 RowFixture - Checking sets of data
Fixture example
Robot Framework
Python-based Keyword-driven test automation framework
Test libraries implemented either in Python or Java (with
remote library available in many other languages thru XML-
RPC)
Test cases are written in tabular format, save in HTML or TSV
files
Syntax similar to natural language
Users can create new keywords from existing ones and
contribute to the project
Preparing Test cases
Workflow tests - takes in initial state, action, verified
that the system behaved as expected
                       Test procedure using keywords


                                                           Keyword arguments
 Test case name


             Test Case            Action               Argument
             Valid Login    Open Login Page
                               Input Name               demo
                             Input Password             mode
                            Submit Credentials
Higher-level test cases
 Free text suitable for communication even with non-
 technical customers
 Support given-when-then format in BDD
Data-driven test cases
 Define a keyword which will take the input data and
 prepare a table with test cases
Test case organisation
 Simple way: Single HTML file containing all test cases
 Test case tagging
Execution
Gathering test cases, reading and setting variables
Executing all actions for every test case
Providing global statistics
Writing the output in XML format
Generating report and log in HTML format
Sample execution result
Sample Test Report
in HTML format, showing all actions executed up to the
failing action, with fail message
Tested application Interface
 Command line
   OperatingSystem
   SSHLibrary
   Telnet library
 Web
   Robot Selenium
 GUI
   Swing GUI library
Adoption
Sense of achievement

Integrity

Openness

Right timing
Facilitate Adoption
 Evangelise - increase awareness
 Lower the bar - quick path to the first success
 Train and educate - from general training to specific needs
 Share and infect - sit together and sharing sessions
 Coach and facilitate - learn about yourselves and cope with the findings
 Involve others - know the stake-holder groups and give them roles
Ideal candidate to work with
 Shared interest in success
 Authority to make decision
 Ability to understand implications
 Ability to explain the domain
Variations - an escape?
 Behaviour-driven development
 Example-driven development
 Executable specifications
 Names do not matter, but underlying practices matter
 Worthwhile to try if your business people do not like
 “testing”
Organisational Challenges
Business Analysts
  Great choice for the facilitator of the spec workshop

  Working with Acceptance tests makes BA’s work easier

Testers
  Help people avoid problems, not to discover them

  Automation of acceptance test gives testers more time to test manual things

Developers
  Spec workshop gives a good chance to discuss with domain experts

  Both unit tests and acceptance tests are important
References
Bridging the Communication Gap
  Gojko Adzic

Practical TDD and ATDD for Java Developers
  Lasse Koskela

Agile Testing
  Lisa Crispin and Janet Gregory
Thank you!
                                  Steven Mak
                   Email: steven@odd-e.com
       Twitter: http://twitter.com/stevenmak

Mais conteúdo relacionado

Mais procurados

Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect couple
Stephen Tucker
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
KMS Technology
 
Agile Testing Strategy
Agile Testing StrategyAgile Testing Strategy
Agile Testing Strategy
tharindakasun
 

Mais procurados (20)

Cypress, Playwright, Selenium, or WebdriverIO? Let the Engineers Speak!
Cypress, Playwright, Selenium, or WebdriverIO? Let the Engineers Speak!Cypress, Playwright, Selenium, or WebdriverIO? Let the Engineers Speak!
Cypress, Playwright, Selenium, or WebdriverIO? Let the Engineers Speak!
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Agile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User GroupAgile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User Group
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test Automation
 
Agile Testing: The Role Of The Agile Tester
Agile Testing: The Role Of The Agile TesterAgile Testing: The Role Of The Agile Tester
Agile Testing: The Role Of The Agile Tester
 
Agile QA and Testing process
Agile QA and Testing processAgile QA and Testing process
Agile QA and Testing process
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect couple
 
Build Your Agile Testing Skill Set
Build Your Agile Testing Skill SetBuild Your Agile Testing Skill Set
Build Your Agile Testing Skill Set
 
Behavior driven development (bdd)
Behavior driven development (bdd)Behavior driven development (bdd)
Behavior driven development (bdd)
 
ATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven DevelopmentATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven Development
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
Selenium DeTox for Achieving the Right Testing Pyramid
Selenium DeTox for Achieving the Right Testing PyramidSelenium DeTox for Achieving the Right Testing Pyramid
Selenium DeTox for Achieving the Right Testing Pyramid
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Agile Testing Strategy
Agile Testing StrategyAgile Testing Strategy
Agile Testing Strategy
 
Agile Testing
Agile Testing  Agile Testing
Agile Testing
 
Agile Testing by Example
Agile Testing by ExampleAgile Testing by Example
Agile Testing by Example
 
Behavior Driven Development Pros and Cons
Behavior Driven Development Pros and ConsBehavior Driven Development Pros and Cons
Behavior Driven Development Pros and Cons
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
[AUG]개발자와 QA가 상생하는 테스트 프로세스
[AUG]개발자와 QA가 상생하는 테스트 프로세스[AUG]개발자와 QA가 상생하는 테스트 프로세스
[AUG]개발자와 QA가 상생하는 테스트 프로세스
 
QA Best Practices in Agile World_new
QA Best Practices in Agile World_newQA Best Practices in Agile World_new
QA Best Practices in Agile World_new
 

Semelhante a ATDD in Practice

Odd E验收测试驱动开发实战
Odd E验收测试驱动开发实战Odd E验收测试驱动开发实战
Odd E验收测试驱动开发实战
George Ang
 
qawithmicrosofttestmanagerandlabmanagement
qawithmicrosofttestmanagerandlabmanagementqawithmicrosofttestmanagerandlabmanagement
qawithmicrosofttestmanagerandlabmanagement
sunil singh
 
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
Tieturi Oy
 
Trends in Agile Testing by Lisa Crispin
Trends in Agile Testing by Lisa CrispinTrends in Agile Testing by Lisa Crispin
Trends in Agile Testing by Lisa Crispin
Directi Group
 
SAP Testing Services
SAP Testing ServicesSAP Testing Services
SAP Testing Services
r_shanki
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven Testing
Maveryx
 
CucumberSeleniumWD
CucumberSeleniumWDCucumberSeleniumWD
CucumberSeleniumWD
Vikas Sarin
 
1 Ads
1 Ads1 Ads
1 Ads
lcbj
 

Semelhante a ATDD in Practice (20)

Odd E验收测试驱动开发实战
Odd E验收测试驱动开发实战Odd E验收测试驱动开发实战
Odd E验收测试驱动开发实战
 
Introduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven DevelopmentIntroduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven Development
 
QA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab ManagementQA with Microsoft Test Manager and Lab Management
QA with Microsoft Test Manager and Lab Management
 
qawithmicrosofttestmanagerandlabmanagement
qawithmicrosofttestmanagerandlabmanagementqawithmicrosofttestmanagerandlabmanagement
qawithmicrosofttestmanagerandlabmanagement
 
Test Driven Development - Overview and Adoption
Test Driven Development - Overview and AdoptionTest Driven Development - Overview and Adoption
Test Driven Development - Overview and Adoption
 
Essential practices and thinking tools for Agile Adoption
Essential practices and thinking tools for Agile AdoptionEssential practices and thinking tools for Agile Adoption
Essential practices and thinking tools for Agile Adoption
 
Agile testing
Agile testingAgile testing
Agile testing
 
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
TechDays 2013 Juhani Lind: Acceptance Test Driven Development With VS 2012
 
Software Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails ApplicationsSoftware Quality and Test Strategies for Ruby and Rails Applications
Software Quality and Test Strategies for Ruby and Rails Applications
 
Trends in Agile Testing by Lisa Crispin
Trends in Agile Testing by Lisa CrispinTrends in Agile Testing by Lisa Crispin
Trends in Agile Testing by Lisa Crispin
 
03 test specification and execution
03   test specification and execution03   test specification and execution
03 test specification and execution
 
Testing Sap: Modern Methodology
Testing Sap: Modern MethodologyTesting Sap: Modern Methodology
Testing Sap: Modern Methodology
 
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual StudioSPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
SPCA2013 - Test-driven Development with SharePoint 2013 and Visual Studio
 
SAP Testing Services
SAP Testing ServicesSAP Testing Services
SAP Testing Services
 
Keyword Driven Testing
Keyword Driven TestingKeyword Driven Testing
Keyword Driven Testing
 
Pariksha testing services
Pariksha testing servicesPariksha testing services
Pariksha testing services
 
CucumberSeleniumWD
CucumberSeleniumWDCucumberSeleniumWD
CucumberSeleniumWD
 
Agile Testing 20021015
Agile Testing 20021015Agile Testing 20021015
Agile Testing 20021015
 
1 Ads
1 Ads1 Ads
1 Ads
 
Incorporating Performance Testing in Agile Development Process
Incorporating Performance Testing in Agile Development ProcessIncorporating Performance Testing in Agile Development Process
Incorporating Performance Testing in Agile Development Process
 

Mais de Steven Mak (9)

Continuous Security Testing
Continuous Security TestingContinuous Security Testing
Continuous Security Testing
 
Quality comes free with open source testing tools
Quality comes free with open source testing toolsQuality comes free with open source testing tools
Quality comes free with open source testing tools
 
Adopting technical practices 2013
Adopting technical practices 2013Adopting technical practices 2013
Adopting technical practices 2013
 
100 doors kata solution
100 doors kata solution100 doors kata solution
100 doors kata solution
 
Bossless companies
Bossless companiesBossless companies
Bossless companies
 
Is this how you hate unit testing?
Is this how you hate unit testing?Is this how you hate unit testing?
Is this how you hate unit testing?
 
Driving Quality with TDD
Driving Quality with TDDDriving Quality with TDD
Driving Quality with TDD
 
Unbearable Test Code Smell
Unbearable Test Code SmellUnbearable Test Code Smell
Unbearable Test Code Smell
 
Sustainable TDD
Sustainable TDDSustainable TDD
Sustainable TDD
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

ATDD in Practice

  • 1. Acceptance Test Driven Development in practice Steven Mak steven@odd-e.com
  • 2. What are we up to now? Lost in translation Do not explain why Gaps discovered only until coding started Cumulative effects of small misunderstandings Inadequate and essentially flawed requirements and specifications
  • 3. Failing to meet actual needs are obvious things really obvious? Imperative requirements Fulfilling specifications does not guarantee success
  • 4. Meeting the needs with Acceptance TDD Acceptance Test Implementation Requirement Feedback Drive implementation of a requirement through a set of automated, executable acceptance tests
  • 5. ATDD in a Nutshell Real-world examples to build a shared understanding of the domain Select a set of these examples to be a specification and an acceptance test suite Automate the verification of acceptance tests Focus the software development effort on the acceptance tests Use the set of acceptance tests to facilitate discussion about future change requests.
  • 6. The ATDD cycle •Implementation of tests usually coding occur before the code is done testing • Feature not done until test passes Feature Specification architecture Done Workshop customer documentation other activities • Activities happen in parallel Developers Testers •Team clarifies and implement the feature Example Product Owner Architect tests together Technical writers •Tests are executable at the end of the ATDD Workshop
  • 7. Benefits of ATDD Comprehensible examples over complex formulas Close Collaboration Definition of Done Trust and Commitment Testing on system level
  • 8. Specification by Examples Use realistic examples to demonstrate differences in possibilities instead of abstract requirements Write specifications down as tables Workflows: Preconditions Processing steps Verifications
  • 9. Examples, Tests, and Spec can become Examples Tests ela rify bo ve ra te Requirements
  • 10. Specification workshop Ask the domain experts Developers and testers should suggest examples of edges or important issues for discussion Ubiquitous language Organise feedback to ensure shared understanding Use facilitator to stay focused if needed
  • 11. Distilling the specifications Write tests collaboratively Examples in a form close to what your automation tool can understand Keep tests in a form that is human-readable Specification over Scripting, describe WHAT, not how Acceptance tests to prevent defects, not to discover Not necessarily automate anything Acceptance tests only work when we can discuss them
  • 12. Some considerations User Interface Easy? Fragile? Performance issues? Boundary of Stub Sufficiently close Simulators? Business logic Not from developer perspective
  • 13. Acceptance Test smells Long tests Parameters of calculation tests that always have the same value Similar test with minor differences Tests that reflect the way code was written Tests fail intermittently even though you didn’t change any code Interdependent tests, e.g. setup for others
  • 14. Change Use existing acceptance tests to discuss future changes Seek advices from customer to determine if it specifies obsolete functionality when test fails Automate periodic execution of regression tests with CI Keep tests in the same version control as code
  • 15. Tools Table-based frameworks FIT, http://fit.c2.com RobotFramework, http://robotframework.org Text-based frameworks Exactor, http://exactor.sourceforge.net TextTest, http://texttest.carmen.se
  • 16. FIT FIT stands for “Framework for Integrated Tests” Most popular framework in-use Table-based Supporting languages like Java, C/C++, C#, Python, or Ruby FitLibrary to extend FIT
  • 17. FIT in practice Test doc with tables Customer writes a Technical staff enhance test document the tables in the doc containing examples Test doc with sanitised tables Technical staff Executable Test implements fixture classes Test doc and backing code (e.g. Java)
  • 18. FIT Document Customers write acceptance tests in their own language using their own tools.
  • 19. Fixtures Take information from the tables and turn them into method calls on the actual application. ColumnFixture - checking rules and calculations ActionFixture - Step-by-step processing RowFixture - Checking sets of data
  • 21. Robot Framework Python-based Keyword-driven test automation framework Test libraries implemented either in Python or Java (with remote library available in many other languages thru XML- RPC) Test cases are written in tabular format, save in HTML or TSV files Syntax similar to natural language Users can create new keywords from existing ones and contribute to the project
  • 22. Preparing Test cases Workflow tests - takes in initial state, action, verified that the system behaved as expected Test procedure using keywords Keyword arguments Test case name Test Case Action Argument Valid Login Open Login Page Input Name demo Input Password mode Submit Credentials
  • 23. Higher-level test cases Free text suitable for communication even with non- technical customers Support given-when-then format in BDD
  • 24. Data-driven test cases Define a keyword which will take the input data and prepare a table with test cases
  • 25. Test case organisation Simple way: Single HTML file containing all test cases Test case tagging
  • 26. Execution Gathering test cases, reading and setting variables Executing all actions for every test case Providing global statistics Writing the output in XML format Generating report and log in HTML format
  • 28. Sample Test Report in HTML format, showing all actions executed up to the failing action, with fail message
  • 29. Tested application Interface Command line OperatingSystem SSHLibrary Telnet library Web Robot Selenium GUI Swing GUI library
  • 31. Facilitate Adoption Evangelise - increase awareness Lower the bar - quick path to the first success Train and educate - from general training to specific needs Share and infect - sit together and sharing sessions Coach and facilitate - learn about yourselves and cope with the findings Involve others - know the stake-holder groups and give them roles
  • 32. Ideal candidate to work with Shared interest in success Authority to make decision Ability to understand implications Ability to explain the domain
  • 33. Variations - an escape? Behaviour-driven development Example-driven development Executable specifications Names do not matter, but underlying practices matter Worthwhile to try if your business people do not like “testing”
  • 34. Organisational Challenges Business Analysts Great choice for the facilitator of the spec workshop Working with Acceptance tests makes BA’s work easier Testers Help people avoid problems, not to discover them Automation of acceptance test gives testers more time to test manual things Developers Spec workshop gives a good chance to discuss with domain experts Both unit tests and acceptance tests are important
  • 35. References Bridging the Communication Gap Gojko Adzic Practical TDD and ATDD for Java Developers Lasse Koskela Agile Testing Lisa Crispin and Janet Gregory
  • 36. Thank you! Steven Mak Email: steven@odd-e.com Twitter: http://twitter.com/stevenmak

Notas do Editor