SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
Acceptance Tests
"no codes goes in until the tests go on"




MSc. Dragan Tomić
Content
- what are acceptance tests
- why do we need them
- who creates them
- when create
- where use
- Details...
- Examples
- Summary
What are acceptance tests
● Acceptance tests
  ○ user's point of view
  ○ external view of system


● Examine externally visible effects
  ○ input and output
  ○ state changes
  ○ external interfaces


● Implementation independent
  (there automation may not be)
Why do we need them?
- Rework down from 60% to 20%
- Workflow working first time
- Getting business rules right (preventing
Rework)
- Tighter cross-functional team integration
- Crisp visible story completion criteria
Classical development
      Elicit          Analyze
                                      Design
  requirements      requirements




     Code                Test         Deploy




                                   Why go back?
- Misunderstandings...
When we create AT's
                            Analyze
       Elicit
                       requirements with       Design
   requirements
                             Tests




    Code with
                            Deploy
      Tests




- AT are created when die Requirements are Analysed
- Developers code with AT (Acceptance Tests)
- Failing AT provides quick feedback
Who creates them
● Author the test
  ○ customer, tester, developer together
● Connect tests to the system              Customer
                                            Tester
  ○ developer or technical testers
                                           Developer
● Run the tests
  ○ developer than tester
  ○ Manual
    or...
  ○ Automated (allows regression tests)
Tests
- Acceptance tests not substitute for interactive
communication
   ○ provides focus for this communication
- Tests in business domain terms
   ○ shared between customer and developer (common
     language)
Details
- Unit tests are not enough
- Objective of acceptance tests (business-facing, not
developer-facing, deliver value to Application's user)
- Too expensive or not?
- Automated Acceptance Test best practices
- The whole team owns the acceptance tests
Creating and maintaining effective AAT's

● Four sections:
  ○   creating acceptance tests
  ○   creating an application driver layer
  ○   implementing acceptance tests
  ○   maintaining acceptance test suites
● INVEST principles
  Independent, Negotiable, Valuable, Estimable, Small, Testable
Creating AAT's
                        Given - state of app when test case begins
                        When - interaction between app and user
                        Then - state of app after that interaction is complete
                        (Cucumber, JBehave, Concordion, Twist or xUnit)


                        DSL - domain-specific language
                        API for the application driver layer



                        translates "high-level" commands to real
                        application data




Advantages: AT independance, simple test data creation
Example 1 (Acceptance Criteria)
Feature: Placing an order
Scenario:
User order should debit account correctly
Given there is an instrument called bond
And there is a user called Dave with 50 dollars in his account
When I log in as Dave
And I select the instrument bond
And I place an order to buy 4 at 10 dollars each
And the order is successful
Then I have 10 dollars left in my account

In Cucumber we would save this AC in a file 'features/placing_an_order.features'
Example 1 (Implementation layer)
Then we creating Ruby file features/step_definitions/placing_an_order_steps.rb
require 'application_driver/admin_api'
require 'application_driver/trading_ui'
Before do
         @admin_api = AdminApi.new
         @trading_ui = TradingUi.new
end
Given /^there is an instrument called (w+)$/ do |instrument|
         @admin_api.create_instrument(instrument)               end
Given /^there is a user called (w+) with (w+) dollars in his account$/ do |user, amount|
         @admin_api.create_user(user, amount)        end
When /^I log in as (w+)$/ do |user|
         @trading_ui.login(user)    end
When /^I select the instrument (w+)$/ do |instrument|
         @trading_ui.select_instrument(instrument) end
When /^I place an order to buy (d+) at (d+) dollars each$/ do |quantity, amount|
         @trading_ui.place_order(quantity, amount) end
When /^the order for (d+) of (w+) at (d+) dollars each is successful$/ do |quantity, instrument, amount|
         @trading_ui.confirm_order_success(instrument, quantity, amount)        end
Then /^I have (d+) dollars left in my account$/ do |balance|
         @trading_ui.confirm_account_balance(balance)           end
Example 1 (Application driver layer)
Feature: Placing an order
        Scenario: User order debits account correctly
        # features/placing_an_order.feature:3
        Given there is an instrument called bond
        # features/step_definitions/placing_an_order_steps.rb:9
        And there is a user called Dave with 50 dollars in his account
        # features/step_definitions/placing_an_order_steps.rb:13
        When I log in as Dave
        # features/step_definitions/placing_an_order_steps.rb:17
        And I select the instrument bond
        # features/step_definitions/placing_an_order_steps.rb:21
        And I place an order to buy 4 at 10 dollars each
        # features/step_definitions/placing_an_order_steps.rb:25
        And the order for 4 of bond at 10 dollars each is successful
        # features/step_definitions/placing_an_order_steps.rb:29
        Then I have 10 dollars left in my account
        # features/step_definitions/placing_an_order_steps.rb:33


1 scenario (1 passed)
7 steps (7 passed)
0m0.016s
Example 1 - Recap
This is the process for creating acceptance tests:
● Discuss acceptance criteria with your customer
● Write them down in the executable format described in
  the Example 1
● Write an implementation for the test which uses only the
  domain language, accessing the application driver layer
● Create an application driver layer which talks to the
  system under test
Example 1 expressed as JUnit test
public class PlacingAnOrderAcceptanceTest extends DSLTestCase {
    @Test
    public void userOrderShouldDebitAccountCorrectly() {
          adminAPI.createInstrument("name: bond");
          adminAPI.createUser("Dave", "balance: 50.00");
          tradingUI.login("Dave");
          tradingUI.selectInstrument("bond");
          tradingUI.placeOrder("price: 10.00", "quantity: 4");
          tradingUI.confirmOrderSuccess("instrument: bond", "price: 10.00",
          "quantity: 4");
          tradingUI.confirmBalance("balance: 10.00");
    }
}
Managing Asynchrony and Timeouts
Has the test failed, or are we just waiting for the result to arrive?
Example:

[Test]
public void ShouldSendEmailOnFileReceipt() {
      ClearAllFilesFromInbox();
      DropFileToInbox();
      ConfirmEmailWasReceived();
}


The email won't have been received by the time we check for its arrival!

Solution:
DELAY PERIOD or some service that handles incoming emails
The Acceptance Test stage
- A build that fails the acceptance tests will not be deployable
- AT threshold is extremely important
- Without excellent AT one of 3 things happens:
     ○   lot of time is spent fixing bugs
     ○   too much time and money spent on manual acceptance and
         regression testing
     ○   end up releasing poor-quality sofware
- Keeping acceptance tests green (when breaks -> team STOP)
- Fail fast (if it is going to fail)
Acceptance Test Performance
- Performance is not a primary concern
(it's more important to have a comprehensive automated test suite)
- Typically, they take hours to complete
- But, there is a spectrum of techniques for
improvement
     ○   parallel testing
     ○   refactor common tasks
     ○   share expensive resources
     ○   using compute grids (use cloud computing)
Summary
- AT simulate user interaction with the system in order to
ensure business requirements
- Providing protection against large-scale changes to
system
- Significantly improving quality through comprehensive
automated regression testing
- Providing fast and reliable feedback whenever a defect
occurs so that it can be fixed immediately
Thank you for your attention!!!

Mais conteúdo relacionado

Mais procurados

Practical TDD Demonstrated
Practical TDD DemonstratedPractical TDD Demonstrated
Practical TDD DemonstratedAlan Christensen
 
Creating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance TestsCreating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance TestsJez Humble
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1Blue Elephant Consulting
 
A Test Automation Framework
A Test Automation FrameworkA Test Automation Framework
A Test Automation FrameworkGregory Solovey
 
Software testing ... who’s responsible is it?
Software testing ... who’s responsible is it?Software testing ... who’s responsible is it?
Software testing ... who’s responsible is it?Manjula03809891
 
Automation test scripting techniques
Automation test scripting techniquesAutomation test scripting techniques
Automation test scripting techniquesZhu Zhong
 
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFTRFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFTYogindernath Gupta
 
Advanced Rational Performance Tester reports
Advanced Rational Performance Tester reportsAdvanced Rational Performance Tester reports
Advanced Rational Performance Tester reportsBill Duncan
 
Model Based Software Testing
Model Based Software TestingModel Based Software Testing
Model Based Software TestingEsin Karaman
 
Program Check List (PCL) FSOFT
Program Check List (PCL) FSOFTProgram Check List (PCL) FSOFT
Program Check List (PCL) FSOFTMobi Marketing
 
Cucumber spec - a tool takes your bdd to the next level
Cucumber spec - a tool takes your bdd to the next levelCucumber spec - a tool takes your bdd to the next level
Cucumber spec - a tool takes your bdd to the next levelnextbuild
 
Testing, fixing, and proving with contracts
Testing, fixing, and proving with contractsTesting, fixing, and proving with contracts
Testing, fixing, and proving with contractsCarlo A. Furia
 

Mais procurados (18)

Practical TDD Demonstrated
Practical TDD DemonstratedPractical TDD Demonstrated
Practical TDD Demonstrated
 
Creating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance TestsCreating Maintainable Automated Acceptance Tests
Creating Maintainable Automated Acceptance Tests
 
An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1An Introduction To Software Development - Test Driven Development, Part 1
An Introduction To Software Development - Test Driven Development, Part 1
 
A Test Automation Framework
A Test Automation FrameworkA Test Automation Framework
A Test Automation Framework
 
Top Testing Tips
Top Testing TipsTop Testing Tips
Top Testing Tips
 
Software testing ... who’s responsible is it?
Software testing ... who’s responsible is it?Software testing ... who’s responsible is it?
Software testing ... who’s responsible is it?
 
Rft courseware
Rft coursewareRft courseware
Rft courseware
 
Priyanka_Resume
Priyanka_ResumePriyanka_Resume
Priyanka_Resume
 
Performance testing and rpt
Performance testing and rptPerformance testing and rpt
Performance testing and rpt
 
Automation test scripting techniques
Automation test scripting techniquesAutomation test scripting techniques
Automation test scripting techniques
 
Automation using ibm rft
Automation using ibm rftAutomation using ibm rft
Automation using ibm rft
 
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFTRFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
RFT Tutorial 4 How Do We Record A Script Using Rational Functional Tester - RFT
 
Effective Software Test Case Design Approach
Effective Software Test Case Design ApproachEffective Software Test Case Design Approach
Effective Software Test Case Design Approach
 
Advanced Rational Performance Tester reports
Advanced Rational Performance Tester reportsAdvanced Rational Performance Tester reports
Advanced Rational Performance Tester reports
 
Model Based Software Testing
Model Based Software TestingModel Based Software Testing
Model Based Software Testing
 
Program Check List (PCL) FSOFT
Program Check List (PCL) FSOFTProgram Check List (PCL) FSOFT
Program Check List (PCL) FSOFT
 
Cucumber spec - a tool takes your bdd to the next level
Cucumber spec - a tool takes your bdd to the next levelCucumber spec - a tool takes your bdd to the next level
Cucumber spec - a tool takes your bdd to the next level
 
Testing, fixing, and proving with contracts
Testing, fixing, and proving with contractsTesting, fixing, and proving with contracts
Testing, fixing, and proving with contracts
 

Semelhante a Acceptance tests

Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choicetoddbr
 
Sivareddy 0000000000000000
Sivareddy 0000000000000000Sivareddy 0000000000000000
Sivareddy 0000000000000000sivareddyeda
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQASymphony
 
Testing - How Vital and How Easy to use
Testing - How Vital and How Easy to useTesting - How Vital and How Easy to use
Testing - How Vital and How Easy to useUma Ghotikar
 
Continuous Performance Testing and Monitoring in Agile Development
Continuous Performance Testing and Monitoring in Agile DevelopmentContinuous Performance Testing and Monitoring in Agile Development
Continuous Performance Testing and Monitoring in Agile DevelopmentDynatrace
 
Performance Testing using LoadRunner
Performance Testing using LoadRunnerPerformance Testing using LoadRunner
Performance Testing using LoadRunnerKumar Gupta
 
SbE - Requirements in an agile process
SbE - Requirements in an agile processSbE - Requirements in an agile process
SbE - Requirements in an agile processChris Schotanus
 
Software Development : Jeremy Gleason Iscope Digital
Software Development : Jeremy Gleason Iscope DigitalSoftware Development : Jeremy Gleason Iscope Digital
Software Development : Jeremy Gleason Iscope DigitalIscope Digital
 
agile with scrum methodology
agile with scrum methodology agile with scrum methodology
agile with scrum methodology rahul reddy
 
Manual testing good notes
Manual testing good notesManual testing good notes
Manual testing good notesdkns0906
 
How to Build a Metrics-optimized Software Delivery Pipeline
How to Build a Metrics-optimized Software Delivery PipelineHow to Build a Metrics-optimized Software Delivery Pipeline
How to Build a Metrics-optimized Software Delivery PipelineDynatrace
 
Release 12 features work arounds and Upgrade
Release 12 features work arounds and UpgradeRelease 12 features work arounds and Upgrade
Release 12 features work arounds and UpgradePrasad Gudipaty M.S., PMP
 
Elite mindz introduction
Elite mindz introductionElite mindz introduction
Elite mindz introductionSimerjeet Singh
 
EliteMindz: Who are we? Where do we serve ? What are our products & services?
EliteMindz: Who are we? Where do we serve ? What are our products & services?EliteMindz: Who are we? Where do we serve ? What are our products & services?
EliteMindz: Who are we? Where do we serve ? What are our products & services?Simerjeet Singh
 
Software testing interview Q&A – Part 2
Software testing interview Q&A – Part 2Software testing interview Q&A – Part 2
Software testing interview Q&A – Part 2Khoa Bui
 
Building a Complete Pipeline: The Essential Components of Continuous Testing ...
Building a Complete Pipeline: The Essential Components of Continuous Testing ...Building a Complete Pipeline: The Essential Components of Continuous Testing ...
Building a Complete Pipeline: The Essential Components of Continuous Testing ...Applitools
 
Kelis king - requirements analysis and the unified process
Kelis king - requirements analysis and the unified processKelis king - requirements analysis and the unified process
Kelis king - requirements analysis and the unified processKelisKing
 
Application Performance, Test and Monitoring
Application Performance, Test and MonitoringApplication Performance, Test and Monitoring
Application Performance, Test and MonitoringDony Riyanto
 
DQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDigendra Vir Singh (DV)
 
Testwarez 2009 Use Proper Tool
Testwarez 2009 Use Proper ToolTestwarez 2009 Use Proper Tool
Testwarez 2009 Use Proper ToolAdam Sandman
 

Semelhante a Acceptance tests (20)

Automated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choiceAutomated Acceptance Tests & Tool choice
Automated Acceptance Tests & Tool choice
 
Sivareddy 0000000000000000
Sivareddy 0000000000000000Sivareddy 0000000000000000
Sivareddy 0000000000000000
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
 
Testing - How Vital and How Easy to use
Testing - How Vital and How Easy to useTesting - How Vital and How Easy to use
Testing - How Vital and How Easy to use
 
Continuous Performance Testing and Monitoring in Agile Development
Continuous Performance Testing and Monitoring in Agile DevelopmentContinuous Performance Testing and Monitoring in Agile Development
Continuous Performance Testing and Monitoring in Agile Development
 
Performance Testing using LoadRunner
Performance Testing using LoadRunnerPerformance Testing using LoadRunner
Performance Testing using LoadRunner
 
SbE - Requirements in an agile process
SbE - Requirements in an agile processSbE - Requirements in an agile process
SbE - Requirements in an agile process
 
Software Development : Jeremy Gleason Iscope Digital
Software Development : Jeremy Gleason Iscope DigitalSoftware Development : Jeremy Gleason Iscope Digital
Software Development : Jeremy Gleason Iscope Digital
 
agile with scrum methodology
agile with scrum methodology agile with scrum methodology
agile with scrum methodology
 
Manual testing good notes
Manual testing good notesManual testing good notes
Manual testing good notes
 
How to Build a Metrics-optimized Software Delivery Pipeline
How to Build a Metrics-optimized Software Delivery PipelineHow to Build a Metrics-optimized Software Delivery Pipeline
How to Build a Metrics-optimized Software Delivery Pipeline
 
Release 12 features work arounds and Upgrade
Release 12 features work arounds and UpgradeRelease 12 features work arounds and Upgrade
Release 12 features work arounds and Upgrade
 
Elite mindz introduction
Elite mindz introductionElite mindz introduction
Elite mindz introduction
 
EliteMindz: Who are we? Where do we serve ? What are our products & services?
EliteMindz: Who are we? Where do we serve ? What are our products & services?EliteMindz: Who are we? Where do we serve ? What are our products & services?
EliteMindz: Who are we? Where do we serve ? What are our products & services?
 
Software testing interview Q&A – Part 2
Software testing interview Q&A – Part 2Software testing interview Q&A – Part 2
Software testing interview Q&A – Part 2
 
Building a Complete Pipeline: The Essential Components of Continuous Testing ...
Building a Complete Pipeline: The Essential Components of Continuous Testing ...Building a Complete Pipeline: The Essential Components of Continuous Testing ...
Building a Complete Pipeline: The Essential Components of Continuous Testing ...
 
Kelis king - requirements analysis and the unified process
Kelis king - requirements analysis and the unified processKelis king - requirements analysis and the unified process
Kelis king - requirements analysis and the unified process
 
Application Performance, Test and Monitoring
Application Performance, Test and MonitoringApplication Performance, Test and Monitoring
Application Performance, Test and Monitoring
 
DQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltdDQ Product Usage Methodology Highlights_v6_ltd
DQ Product Usage Methodology Highlights_v6_ltd
 
Testwarez 2009 Use Proper Tool
Testwarez 2009 Use Proper ToolTestwarez 2009 Use Proper Tool
Testwarez 2009 Use Proper Tool
 

Último

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Último (20)

Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Acceptance tests

  • 1. Acceptance Tests "no codes goes in until the tests go on" MSc. Dragan Tomić
  • 2. Content - what are acceptance tests - why do we need them - who creates them - when create - where use - Details... - Examples - Summary
  • 3. What are acceptance tests ● Acceptance tests ○ user's point of view ○ external view of system ● Examine externally visible effects ○ input and output ○ state changes ○ external interfaces ● Implementation independent (there automation may not be)
  • 4. Why do we need them? - Rework down from 60% to 20% - Workflow working first time - Getting business rules right (preventing Rework) - Tighter cross-functional team integration - Crisp visible story completion criteria
  • 5. Classical development Elicit Analyze Design requirements requirements Code Test Deploy Why go back? - Misunderstandings...
  • 6. When we create AT's Analyze Elicit requirements with Design requirements Tests Code with Deploy Tests - AT are created when die Requirements are Analysed - Developers code with AT (Acceptance Tests) - Failing AT provides quick feedback
  • 7. Who creates them ● Author the test ○ customer, tester, developer together ● Connect tests to the system Customer Tester ○ developer or technical testers Developer ● Run the tests ○ developer than tester ○ Manual or... ○ Automated (allows regression tests)
  • 8. Tests - Acceptance tests not substitute for interactive communication ○ provides focus for this communication - Tests in business domain terms ○ shared between customer and developer (common language)
  • 9. Details - Unit tests are not enough - Objective of acceptance tests (business-facing, not developer-facing, deliver value to Application's user) - Too expensive or not? - Automated Acceptance Test best practices - The whole team owns the acceptance tests
  • 10. Creating and maintaining effective AAT's ● Four sections: ○ creating acceptance tests ○ creating an application driver layer ○ implementing acceptance tests ○ maintaining acceptance test suites ● INVEST principles Independent, Negotiable, Valuable, Estimable, Small, Testable
  • 11. Creating AAT's Given - state of app when test case begins When - interaction between app and user Then - state of app after that interaction is complete (Cucumber, JBehave, Concordion, Twist or xUnit) DSL - domain-specific language API for the application driver layer translates "high-level" commands to real application data Advantages: AT independance, simple test data creation
  • 12. Example 1 (Acceptance Criteria) Feature: Placing an order Scenario: User order should debit account correctly Given there is an instrument called bond And there is a user called Dave with 50 dollars in his account When I log in as Dave And I select the instrument bond And I place an order to buy 4 at 10 dollars each And the order is successful Then I have 10 dollars left in my account In Cucumber we would save this AC in a file 'features/placing_an_order.features'
  • 13. Example 1 (Implementation layer) Then we creating Ruby file features/step_definitions/placing_an_order_steps.rb require 'application_driver/admin_api' require 'application_driver/trading_ui' Before do @admin_api = AdminApi.new @trading_ui = TradingUi.new end Given /^there is an instrument called (w+)$/ do |instrument| @admin_api.create_instrument(instrument) end Given /^there is a user called (w+) with (w+) dollars in his account$/ do |user, amount| @admin_api.create_user(user, amount) end When /^I log in as (w+)$/ do |user| @trading_ui.login(user) end When /^I select the instrument (w+)$/ do |instrument| @trading_ui.select_instrument(instrument) end When /^I place an order to buy (d+) at (d+) dollars each$/ do |quantity, amount| @trading_ui.place_order(quantity, amount) end When /^the order for (d+) of (w+) at (d+) dollars each is successful$/ do |quantity, instrument, amount| @trading_ui.confirm_order_success(instrument, quantity, amount) end Then /^I have (d+) dollars left in my account$/ do |balance| @trading_ui.confirm_account_balance(balance) end
  • 14. Example 1 (Application driver layer) Feature: Placing an order Scenario: User order debits account correctly # features/placing_an_order.feature:3 Given there is an instrument called bond # features/step_definitions/placing_an_order_steps.rb:9 And there is a user called Dave with 50 dollars in his account # features/step_definitions/placing_an_order_steps.rb:13 When I log in as Dave # features/step_definitions/placing_an_order_steps.rb:17 And I select the instrument bond # features/step_definitions/placing_an_order_steps.rb:21 And I place an order to buy 4 at 10 dollars each # features/step_definitions/placing_an_order_steps.rb:25 And the order for 4 of bond at 10 dollars each is successful # features/step_definitions/placing_an_order_steps.rb:29 Then I have 10 dollars left in my account # features/step_definitions/placing_an_order_steps.rb:33 1 scenario (1 passed) 7 steps (7 passed) 0m0.016s
  • 15. Example 1 - Recap This is the process for creating acceptance tests: ● Discuss acceptance criteria with your customer ● Write them down in the executable format described in the Example 1 ● Write an implementation for the test which uses only the domain language, accessing the application driver layer ● Create an application driver layer which talks to the system under test
  • 16. Example 1 expressed as JUnit test public class PlacingAnOrderAcceptanceTest extends DSLTestCase { @Test public void userOrderShouldDebitAccountCorrectly() { adminAPI.createInstrument("name: bond"); adminAPI.createUser("Dave", "balance: 50.00"); tradingUI.login("Dave"); tradingUI.selectInstrument("bond"); tradingUI.placeOrder("price: 10.00", "quantity: 4"); tradingUI.confirmOrderSuccess("instrument: bond", "price: 10.00", "quantity: 4"); tradingUI.confirmBalance("balance: 10.00"); } }
  • 17. Managing Asynchrony and Timeouts Has the test failed, or are we just waiting for the result to arrive? Example: [Test] public void ShouldSendEmailOnFileReceipt() { ClearAllFilesFromInbox(); DropFileToInbox(); ConfirmEmailWasReceived(); } The email won't have been received by the time we check for its arrival! Solution: DELAY PERIOD or some service that handles incoming emails
  • 18. The Acceptance Test stage - A build that fails the acceptance tests will not be deployable - AT threshold is extremely important - Without excellent AT one of 3 things happens: ○ lot of time is spent fixing bugs ○ too much time and money spent on manual acceptance and regression testing ○ end up releasing poor-quality sofware - Keeping acceptance tests green (when breaks -> team STOP) - Fail fast (if it is going to fail)
  • 19. Acceptance Test Performance - Performance is not a primary concern (it's more important to have a comprehensive automated test suite) - Typically, they take hours to complete - But, there is a spectrum of techniques for improvement ○ parallel testing ○ refactor common tasks ○ share expensive resources ○ using compute grids (use cloud computing)
  • 20. Summary - AT simulate user interaction with the system in order to ensure business requirements - Providing protection against large-scale changes to system - Significantly improving quality through comprehensive automated regression testing - Providing fast and reliable feedback whenever a defect occurs so that it can be fixed immediately
  • 21. Thank you for your attention!!!