SlideShare une entreprise Scribd logo
1  sur  13
Test Execution
Automating Test Execution
• Designing test cases and test suites is creative
– Like any design activity: A demanding intellectual
activity, requiring human judgment
• Executing test cases should be automatic
– Design once, execute many times
• Test automation separates the creative human
process from the mechanical process of test
execution
Generation: From Test Case
Specifications to Test Cases
• Test design often yields test case
specifications, rather than concrete data
– Ex: “a large positive number”, not 420023
– Ex: “a sorted sequence, length > 2”, not “Alpha,
Beta, Chi, Omega”
• Other details for execution may be omitted
• Generation creates executable test cases from
test case specifications
Scaffolding
• Code produced to
support development
activities (especially
testing)
– Not part of the “product”
as seen by the end user
– May be temporary (like
scaffolding in construction
of buildings
• Includes
– Test harnesses, drivers,
and stubs
Scaffolding ...
• Test driver
– A “main” program for running a test
• May be produced before a “real” main program
• Provides more control than the “real” main program
– To driver program under test through test cases
• Test stubs
– Substitute for called functions/methods/objects
• Test harness
– Substitutes for other parts of the deployed
environment
• Ex: Software simulation of a hardware device
Controllability & Observability
GUI input (MVC “Controller”)
Program Functionality
Graphical ouput (MVC “View”)
Example: We want
automated tests, but
interactive input provides
limited control and graphical
output provides limited
observability
Controllability & Observability
GUI input (MVC “Controller”)
Program Functionality
Graphical ouput (MVC “View”)
API
Test driver
Capture wrapper
Log behavior
A design for automated test
includes provides interfaces
for control (API) and
observation (wrapper on
ouput).
Generic or Specific?
• The simplest form of scaffolding is a driver
program that runs a single, specific test case.
• How general should scaffolding be?
– We could build a driver and stubs for each test case
– ... or at least factor out some common code of the
driver and test management (e.g., JUnit)
– ... or further factor out some common support code,
to drive a large number of test cases from data
– ... or further, generate the data automatically from
a more abstract model (e.g., network traffic model)
• A question of costs and re-use
– Just as for other kinds of software
Oracles
• Did this test case succeed, or fail?
– No use running 10,000 test cases automatically if the
results must be checked by hand!
• Software that applies a pass/fail criterion to a
program execution is called a test oracle,
often shortened to oracle.
• In addition to rapidly classifying a large
number of test case executions, automated test
oracles make it possible to classify behaviours
that exceed human
Comparison-based oracle
• With a comparison-based oracle, we need predicted
output for each input
– Oracle compares actual to predicted output, and reports failure
if they differ
• Fine for a small number of hand-generated test cases
– E.g., for hand-written JUnit test cases
Self-Checking Code as Oracle
• An oracle can also be written as self-checks
– Often possible to judge correctness without predicting results
• Advantages and limits: Usable with large, automatically
generated test suites, but often only a partial check
– e.g., structural invariants of data structures
– recognize many or most failures, but not all
Capture and Replay
• Sometimes there is no alternative to human
input and observation
– Even if we separate testing program functionality
from GUI, some testing of the GUI is required
• We can at least cut repetition of human testing
• Capture a manually run test case, replay it
automatically
– with a comparison-based test oracle: behavior same
as previously accepted behavior
• reusable only until a program change invalidates it
• lifetime depends on abstraction level of input and output
Summary
• Goal: Separate creative task of test design from
mechanical task of test execution
– Enable generation and execution of large test suites
– Re-execute test suites frequently (e.g., nightly or
after each program change)
• Scaffolding: Code to support development and
testing
– Test drivers, stubs, harness, including oracles
– Ranging from individual, hand-written test case
drivers to automatic generation and testing of large
test suites
– Capture/replay where human interaction is required

Contenu connexe

Similaire à TEST EXECUTION.ppt

VCS_QAPerformanceSlides
VCS_QAPerformanceSlidesVCS_QAPerformanceSlides
VCS_QAPerformanceSlides
Michael Cowan
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2
 
Introduction to Total Data Driven Test Automation
Introduction to Total Data Driven Test AutomationIntroduction to Total Data Driven Test Automation
Introduction to Total Data Driven Test Automation
VNITO Alliance
 
Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
QA or the Highway
 
Qtp training session I
Qtp training session IQtp training session I
Qtp training session I
Aisha Mazhar
 

Similaire à TEST EXECUTION.ppt (20)

Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Software automation
Software automationSoftware automation
Software automation
 
VCS_QAPerformanceSlides
VCS_QAPerformanceSlidesVCS_QAPerformanceSlides
VCS_QAPerformanceSlides
 
Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014Cloud-based Test Microservices JavaOne 2014
Cloud-based Test Microservices JavaOne 2014
 
Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)Lecture #6. automation testing (andrey oleynik)
Lecture #6. automation testing (andrey oleynik)
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
Wso2con test-automation
Wso2con test-automationWso2con test-automation
Wso2con test-automation
 
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile EnvironmentWSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
WSO2Con Asia 2014 - Effective Test Automation in an Agile Environment
 
Introduction to Total Data Driven Test Automation
Introduction to Total Data Driven Test AutomationIntroduction to Total Data Driven Test Automation
Introduction to Total Data Driven Test Automation
 
Object Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesObject Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slides
 
Automated testing overview
Automated testing overviewAutomated testing overview
Automated testing overview
 
Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
 
Test planning and software's engineering
Test planning and software's engineeringTest planning and software's engineering
Test planning and software's engineering
 
Test automation lesson
Test automation lessonTest automation lesson
Test automation lesson
 
Test automation - Building effective solutions
Test automation - Building effective solutionsTest automation - Building effective solutions
Test automation - Building effective solutions
 
Qtp training session I
Qtp training session IQtp training session I
Qtp training session I
 
iSYSTEM Company and Product Overview v12.02
iSYSTEM Company and Product Overview v12.02iSYSTEM Company and Product Overview v12.02
iSYSTEM Company and Product Overview v12.02
 
testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2testing throughout-the-software-life-cycle-section-2
testing throughout-the-software-life-cycle-section-2
 
Small is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case DesignSmall is Beautiful- Fully Automate your Test Case Design
Small is Beautiful- Fully Automate your Test Case Design
 
Object oriented testing
Object oriented testingObject oriented testing
Object oriented testing
 

Dernier

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
heathfieldcps1
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Dernier (20)

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...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
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
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
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
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
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
 

TEST EXECUTION.ppt

  • 2. Automating Test Execution • Designing test cases and test suites is creative – Like any design activity: A demanding intellectual activity, requiring human judgment • Executing test cases should be automatic – Design once, execute many times • Test automation separates the creative human process from the mechanical process of test execution
  • 3. Generation: From Test Case Specifications to Test Cases • Test design often yields test case specifications, rather than concrete data – Ex: “a large positive number”, not 420023 – Ex: “a sorted sequence, length > 2”, not “Alpha, Beta, Chi, Omega” • Other details for execution may be omitted • Generation creates executable test cases from test case specifications
  • 4. Scaffolding • Code produced to support development activities (especially testing) – Not part of the “product” as seen by the end user – May be temporary (like scaffolding in construction of buildings • Includes – Test harnesses, drivers, and stubs
  • 5. Scaffolding ... • Test driver – A “main” program for running a test • May be produced before a “real” main program • Provides more control than the “real” main program – To driver program under test through test cases • Test stubs – Substitute for called functions/methods/objects • Test harness – Substitutes for other parts of the deployed environment • Ex: Software simulation of a hardware device
  • 6. Controllability & Observability GUI input (MVC “Controller”) Program Functionality Graphical ouput (MVC “View”) Example: We want automated tests, but interactive input provides limited control and graphical output provides limited observability
  • 7. Controllability & Observability GUI input (MVC “Controller”) Program Functionality Graphical ouput (MVC “View”) API Test driver Capture wrapper Log behavior A design for automated test includes provides interfaces for control (API) and observation (wrapper on ouput).
  • 8. Generic or Specific? • The simplest form of scaffolding is a driver program that runs a single, specific test case. • How general should scaffolding be? – We could build a driver and stubs for each test case – ... or at least factor out some common code of the driver and test management (e.g., JUnit) – ... or further factor out some common support code, to drive a large number of test cases from data – ... or further, generate the data automatically from a more abstract model (e.g., network traffic model) • A question of costs and re-use – Just as for other kinds of software
  • 9. Oracles • Did this test case succeed, or fail? – No use running 10,000 test cases automatically if the results must be checked by hand! • Software that applies a pass/fail criterion to a program execution is called a test oracle, often shortened to oracle. • In addition to rapidly classifying a large number of test case executions, automated test oracles make it possible to classify behaviours that exceed human
  • 10. Comparison-based oracle • With a comparison-based oracle, we need predicted output for each input – Oracle compares actual to predicted output, and reports failure if they differ • Fine for a small number of hand-generated test cases – E.g., for hand-written JUnit test cases
  • 11. Self-Checking Code as Oracle • An oracle can also be written as self-checks – Often possible to judge correctness without predicting results • Advantages and limits: Usable with large, automatically generated test suites, but often only a partial check – e.g., structural invariants of data structures – recognize many or most failures, but not all
  • 12. Capture and Replay • Sometimes there is no alternative to human input and observation – Even if we separate testing program functionality from GUI, some testing of the GUI is required • We can at least cut repetition of human testing • Capture a manually run test case, replay it automatically – with a comparison-based test oracle: behavior same as previously accepted behavior • reusable only until a program change invalidates it • lifetime depends on abstraction level of input and output
  • 13. Summary • Goal: Separate creative task of test design from mechanical task of test execution – Enable generation and execution of large test suites – Re-execute test suites frequently (e.g., nightly or after each program change) • Scaffolding: Code to support development and testing – Test drivers, stubs, harness, including oracles – Ranging from individual, hand-written test case drivers to automatic generation and testing of large test suites – Capture/replay where human interaction is required