SlideShare a Scribd company logo
1 of 23
Object Oriented Testing
and Test-Driven Development
Objectives
 To discuss when testing takes place in the life cycle
 Test-driven development advocates early testing!
 To cover the strategies and tools associated with
object oriented testing
 Analysis and Design Testing
 Class Tests
 Integration Tests
 Validation Tests
 System Tests
 To discuss test plans and execution for projects
analysis design code test ?
Object-Oriented Testing
 When should testing begin?
 Analysis and Design:
 Testing begins by evaluating the OOA and OOD models
 How do we test OOA models (requirements and use cases)?
 How do we test OOD models (class and sequence diagrams)?
 Structured walk-throughs, prototypes
 Formal reviews of correctness, completeness and consistency
 Programming:
 How does OO make testing different from procedural programming?
 Concept of a ‘unit’ broadens due to class encapsulation
 Integration focuses on classes and their context of a use case scenario
or their execution across a thread
 Validation may still use conventional black box methods
Test-driven programming
 eXtreme Programming (XP) advocates writing tests
for units before writing actual code for units
 Why might this practice be a good idea?
 Constrains code to design: How so?
 Design -> Test -> Code … in small iterations
 Promotes validation and reliability: Why?
 Always rerun all tests (easier with automated testing)
before integrating new code in a release
 Increases confidence to change code: Why?
 Changes shouldn’t break old code if you can test old code
 Creed of XP: “embrace change”
The Bug Curve
Criteria for Completion of Testing
 When are we done testing? (Are we there yet?)
 How to answer this question is still a research question
1. One view: testing is never done… the burden simply shifts
from the developer to the customer
2. Or: testing is done when you run out of time or money
3. Or use a statistical model:
 Assume that errors decay logarithmically with testing time
 Measure the number of errors in a unit period
 Fit these measurements to a logarithmic curve
 Can then say: “with our experimentally valid statistical model we
have done sufficient testing to say that with 95% confidence the
probability of 1000 CPU hours of failure free operation is at least
0.995”
YAHOO!
Strategic Issues
 Issues for a successful software testing strategy:
 Specify product requirements long before testing commences
For example: portability, maintainability, usability
Do so in a manner that is unambiguous and quantifiable
 Understand the users of the software, with use cases
 Develop a testing plan that emphasizes “rapid cycle testing”
Get quick feedback from a series of small incremental tests
 Build robust software that is designed to test itself
Use assertions, exception handling and automated testing tools
(Junit).
 Conduct formal technical reviews to assess test strategy
and test cases - “Who watches the watchers?”
Testing Analysis and Design
 Syntactic correctness:
 Are UML and ADT notation used correctly?
 Semantic correctness:
 Does the model reflect the real world problem?
 Is UML used as intended by its designers?
 Is the ADT design complete (capturing all the classes
and operations in UML diagram) and understandable?
 Testing for consistency:
 An inconsistent model has representations in one part
that are not reflected in other portions of the model
Testing the Class Model
1. Revisit the Use Cases, CRC cards and UML class model.
Check that all collaborations are properly represented.
Inspect the description of each CRC index card to make sure a
delegated responsibility is part of the collaborator’s definition.
 Example: in a point of sale system.
 A read credit card responsibility of a credit sale class is accomplished if
satisfied by a credit card collaborator
2. Invert connections to ensure that each collaborator asked for a
service is receiving requests from a reasonable source
 Example: a credit card being asked for a purchase amount
 Have you tested your analysis and design?
 If not, who will do it?
Testing OO Code
Class tests Integration
tests
Validation
tests
System
tests
[1] Class (Unit) Testing
 Smallest testable unit is the encapsulated class
 Test each operation as part of a class hierarchy
because its class hierarchy defines its context of use
 Approach:
 Test each method (and constructor) within a class
 Test the state behavior (attributes) of the class between methods
 How is class testing different from conventional testing?
 Conventional testing focuses on input-process-output,
whereas class testing focuses on each method, then
designing sequences of methods to exercise states of a class
 But white-box testing can still be applied
Class Testing Process
class
to be
tested
test cases
results
software
engineer
How to test?
Why a loop?
Class Test Case Design
1. Identify each test case uniquely
- Associate test case explicitly with the class and/or method to be tested
2. State the purpose of the test
3. Each test case should contain:
a. A list of messages and operations that will be exercised as a
consequence of the test
b. A list of exceptions that may occur as the object is tested
c. A list of external conditions for setup (i.e., changes in the
environment external to the software that must exist in order to
properly conduct the test)
d. Supplementary information that will aid in understanding or
implementing the test
 Automated unit testing tools facilitate these requirements
Challenges of Class Testing
 Encapsulation:
 Difficult to obtain a snapshot of a class without building extra
methods which display the classes’ state
 Inheritance and polymorphism:
 Each new context of use (subclass) requires re-testing because a
method may be implemented differently (polymorphism).
 Other unaltered methods within the subclass may use the redefined
method and need to be tested
 White box tests:
 Basis path, condition, data flow and loop tests can all apply to
individual methods, but don’t test interactions between methods
Random Class Testing
1. Identify methods applicable to a class
2. Define constraints on their use – e.g. the class must always
be initialized first
3. Identify a minimum test sequence – an operation sequence
that defines the minimum life history of the class
4. Generate a variety of random (but valid) test sequences –
this exercises more complex class instance life histories
 Example:
1. An account class in a banking application has open, setup, deposit,
withdraw, balance, summarize and close methods
2. The account must be opened first and closed on completion
3. Open – setup – deposit – withdraw – close
4. Open – setup – deposit –* [deposit | withdraw | balance | summarize]
– withdraw – close. Generate random test sequences using this
template
[2] Integration Testing
 OO does not have a hierarchical control structure so
conventional top-down and bottom-up integration tests
have little meaning
 Integration applied three different incremental strategies:
 Thread-based testing: integrates classes required to respond to one
input or event
 Use-based testing: integrates classes required by one use case
 Cluster testing: integrates classes required to demonstrate one
collaboration
• What integration testing strategies will you use?
Random Integration Testing
 Multiple Class Random Testing
1. For each client class, use the list of class methods to
generate a series of random test sequences.
Methods will send messages to other server classes.
2. For each message that is generated, determine the
collaborating class and the corresponding method in
the server object.
3. For each method in the server object (that has been
invoked by messages sent from the client object),
determine the messages that it transmits
4. For each of the messages, determine the next level of
methods that are invoked and incorporate these into
the test sequence
[3] Validation Testing
 Are we building the right product?
 Validation succeeds when software functions in a manner
that can be reasonably expected by the customer.
 Focus on user-visible actions and user-recognizable outputs
 Details of class connections disappear at this level
 Apply:
 Use-case scenarios from the software requirements spec
 Black-box testing to create a deficiency list
 Acceptance tests through alpha (at developer’s site) and beta (at
customer’s site) testing with actual customers
 How will you validate your term product?
Acceptance testing, anyone?
[4] System Testing
 Software may be part of a larger system. This often leads
to “finger pointing” by other system dev teams
 Finger pointing defence:
1. Design error-handling paths that test external information
2. Conduct a series of tests that simulate bad data
3. Record the results of tests to use as evidence
 Types of System Testing:
 Recovery testing: how well and quickly does the system recover
from faults
 Security testing: verify that protection mechanisms built into the
system will protect from unauthorized access (hackers,
disgruntled employees, fraudsters)
 Stress testing: place abnormal load on the system
 Performance testing: investigate the run-time performance within
the context of an integrated system
Can we
do better?
Testing Summary
 Testing affects all stages of software engineering cycle
 One strategy is a bottom-up approach – class,
integration, validation and system level testing
 XP advocates test-driven development: plan tests
before you write any code, then test any changes
 Other techniques:
 white box (look into technical internal details)
 black box (view the external behaviour)
 debugging (systematic cause elimination approach is best)
analysis design code test

More Related Content

Similar to types of testing with descriptions and examples

Similar to types of testing with descriptions and examples (20)

Software testing for biginners
Software testing for biginnersSoftware testing for biginners
Software testing for biginners
 
object oriented system analysis and design
object oriented system analysis and designobject oriented system analysis and design
object oriented system analysis and design
 
Software testing introduction
Software testing introductionSoftware testing introduction
Software testing introduction
 
Test case development
Test case developmentTest case development
Test case development
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
MIT521 software testing (2012) v2
MIT521   software testing  (2012) v2MIT521   software testing  (2012) v2
MIT521 software testing (2012) v2
 
Software testing part
Software testing partSoftware testing part
Software testing part
 
Istqb lesson1
Istqb lesson1Istqb lesson1
Istqb lesson1
 
Testing
TestingTesting
Testing
 
Test Levels & Techniques
Test Levels & TechniquesTest Levels & Techniques
Test Levels & Techniques
 
Unit testing basics with NUnit and Visual Studio
Unit testing basics with NUnit and Visual StudioUnit testing basics with NUnit and Visual Studio
Unit testing basics with NUnit and Visual Studio
 
Role+Of+Testing+In+Sdlc
Role+Of+Testing+In+SdlcRole+Of+Testing+In+Sdlc
Role+Of+Testing+In+Sdlc
 
Unit 3 for st
Unit 3 for stUnit 3 for st
Unit 3 for st
 
Testing throughout the software life cycle
Testing throughout the software life cycleTesting throughout the software life cycle
Testing throughout the software life cycle
 
Unit2 for st
Unit2 for stUnit2 for st
Unit2 for st
 
T0 numtq0nje=
T0 numtq0nje=T0 numtq0nje=
T0 numtq0nje=
 
Presentasi testing throughout the software life cycle 2
Presentasi testing throughout the software life cycle 2Presentasi testing throughout the software life cycle 2
Presentasi testing throughout the software life cycle 2
 
Salesforce testing best_practices
Salesforce testing best_practicesSalesforce testing best_practices
Salesforce testing best_practices
 
Testing
TestingTesting
Testing
 
Phase 3 - Task 1Task TypeDiscussion BoardDeliverable Length.docx
Phase 3 - Task 1Task TypeDiscussion BoardDeliverable Length.docxPhase 3 - Task 1Task TypeDiscussion BoardDeliverable Length.docx
Phase 3 - Task 1Task TypeDiscussion BoardDeliverable Length.docx
 

More from Mani Deepak Choudhry

LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationMani Deepak Choudhry
 
L13 Plume Rise, types, methods, applications
L13 Plume Rise, types, methods, applicationsL13 Plume Rise, types, methods, applications
L13 Plume Rise, types, methods, applicationsMani Deepak Choudhry
 
L10 Inversions in atmospheric stability, conditions
L10 Inversions in atmospheric stability, conditionsL10 Inversions in atmospheric stability, conditions
L10 Inversions in atmospheric stability, conditionsMani Deepak Choudhry
 
UNIT II - meteorology, occurrence, process
UNIT II - meteorology, occurrence, processUNIT II - meteorology, occurrence, process
UNIT II - meteorology, occurrence, processMani Deepak Choudhry
 
L11 Wind profiles and stack plume patterns.pptx
L11 Wind profiles and stack plume patterns.pptxL11 Wind profiles and stack plume patterns.pptx
L11 Wind profiles and stack plume patterns.pptxMani Deepak Choudhry
 
LM7 - Ambient Air Quality and Emission standards..pptx
LM7 - Ambient Air Quality and Emission standards..pptxLM7 - Ambient Air Quality and Emission standards..pptx
LM7 - Ambient Air Quality and Emission standards..pptxMani Deepak Choudhry
 
LM16 - Gravity Separators, methods, measures
LM16 - Gravity Separators, methods, measuresLM16 - Gravity Separators, methods, measures
LM16 - Gravity Separators, methods, measuresMani Deepak Choudhry
 
LM14,15 - Air Pollution Control, measures
LM14,15 - Air Pollution Control, measuresLM14,15 - Air Pollution Control, measures
LM14,15 - Air Pollution Control, measuresMani Deepak Choudhry
 
LM9 - Fundamentals, Atmospheric stability.pptx
LM9 - Fundamentals, Atmospheric stability.pptxLM9 - Fundamentals, Atmospheric stability.pptx
LM9 - Fundamentals, Atmospheric stability.pptxMani Deepak Choudhry
 
LM8 - Effects of meteorology on Air Pollution.pptx
LM8 - Effects of meteorology on Air Pollution.pptxLM8 - Effects of meteorology on Air Pollution.pptx
LM8 - Effects of meteorology on Air Pollution.pptxMani Deepak Choudhry
 
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptx
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptxLM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptx
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptxMani Deepak Choudhry
 
LM5 - Effect of air Pollutants on Vegetation & animals.pptx
LM5 - Effect of air Pollutants on Vegetation & animals.pptxLM5 - Effect of air Pollutants on Vegetation & animals.pptx
LM5 - Effect of air Pollutants on Vegetation & animals.pptxMani Deepak Choudhry
 
LM4 - Classification of air pollutants and their effect on human health.pptx
LM4 - Classification of air pollutants and their effect on human health.pptxLM4 - Classification of air pollutants and their effect on human health.pptx
LM4 - Classification of air pollutants and their effect on human health.pptxMani Deepak Choudhry
 
LM2 - Definition, Scope & Scales of Air Pollution.pptx
LM2 - Definition, Scope & Scales of Air Pollution.pptxLM2 - Definition, Scope & Scales of Air Pollution.pptx
LM2 - Definition, Scope & Scales of Air Pollution.pptxMani Deepak Choudhry
 
LM1 - Structure & Composition of Atmosphere.pptx
LM1 - Structure & Composition of Atmosphere.pptxLM1 - Structure & Composition of Atmosphere.pptx
LM1 - Structure & Composition of Atmosphere.pptxMani Deepak Choudhry
 
Safety Terminologies, measures, hazards and risks
Safety Terminologies, measures, hazards and risksSafety Terminologies, measures, hazards and risks
Safety Terminologies, measures, hazards and risksMani Deepak Choudhry
 
Software Configuration Management introduction
Software Configuration Management introductionSoftware Configuration Management introduction
Software Configuration Management introductionMani Deepak Choudhry
 
Meta Safety Data Sheets for hazardous materials
Meta Safety Data Sheets for hazardous materialsMeta Safety Data Sheets for hazardous materials
Meta Safety Data Sheets for hazardous materialsMani Deepak Choudhry
 
Personnel Protective Equipment along with measures
Personnel Protective Equipment along with measuresPersonnel Protective Equipment along with measures
Personnel Protective Equipment along with measuresMani Deepak Choudhry
 
object oriented testing with types of testing
object oriented testing with types of testingobject oriented testing with types of testing
object oriented testing with types of testingMani Deepak Choudhry
 

More from Mani Deepak Choudhry (20)

LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
 
L13 Plume Rise, types, methods, applications
L13 Plume Rise, types, methods, applicationsL13 Plume Rise, types, methods, applications
L13 Plume Rise, types, methods, applications
 
L10 Inversions in atmospheric stability, conditions
L10 Inversions in atmospheric stability, conditionsL10 Inversions in atmospheric stability, conditions
L10 Inversions in atmospheric stability, conditions
 
UNIT II - meteorology, occurrence, process
UNIT II - meteorology, occurrence, processUNIT II - meteorology, occurrence, process
UNIT II - meteorology, occurrence, process
 
L11 Wind profiles and stack plume patterns.pptx
L11 Wind profiles and stack plume patterns.pptxL11 Wind profiles and stack plume patterns.pptx
L11 Wind profiles and stack plume patterns.pptx
 
LM7 - Ambient Air Quality and Emission standards..pptx
LM7 - Ambient Air Quality and Emission standards..pptxLM7 - Ambient Air Quality and Emission standards..pptx
LM7 - Ambient Air Quality and Emission standards..pptx
 
LM16 - Gravity Separators, methods, measures
LM16 - Gravity Separators, methods, measuresLM16 - Gravity Separators, methods, measures
LM16 - Gravity Separators, methods, measures
 
LM14,15 - Air Pollution Control, measures
LM14,15 - Air Pollution Control, measuresLM14,15 - Air Pollution Control, measures
LM14,15 - Air Pollution Control, measures
 
LM9 - Fundamentals, Atmospheric stability.pptx
LM9 - Fundamentals, Atmospheric stability.pptxLM9 - Fundamentals, Atmospheric stability.pptx
LM9 - Fundamentals, Atmospheric stability.pptx
 
LM8 - Effects of meteorology on Air Pollution.pptx
LM8 - Effects of meteorology on Air Pollution.pptxLM8 - Effects of meteorology on Air Pollution.pptx
LM8 - Effects of meteorology on Air Pollution.pptx
 
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptx
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptxLM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptx
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptx
 
LM5 - Effect of air Pollutants on Vegetation & animals.pptx
LM5 - Effect of air Pollutants on Vegetation & animals.pptxLM5 - Effect of air Pollutants on Vegetation & animals.pptx
LM5 - Effect of air Pollutants on Vegetation & animals.pptx
 
LM4 - Classification of air pollutants and their effect on human health.pptx
LM4 - Classification of air pollutants and their effect on human health.pptxLM4 - Classification of air pollutants and their effect on human health.pptx
LM4 - Classification of air pollutants and their effect on human health.pptx
 
LM2 - Definition, Scope & Scales of Air Pollution.pptx
LM2 - Definition, Scope & Scales of Air Pollution.pptxLM2 - Definition, Scope & Scales of Air Pollution.pptx
LM2 - Definition, Scope & Scales of Air Pollution.pptx
 
LM1 - Structure & Composition of Atmosphere.pptx
LM1 - Structure & Composition of Atmosphere.pptxLM1 - Structure & Composition of Atmosphere.pptx
LM1 - Structure & Composition of Atmosphere.pptx
 
Safety Terminologies, measures, hazards and risks
Safety Terminologies, measures, hazards and risksSafety Terminologies, measures, hazards and risks
Safety Terminologies, measures, hazards and risks
 
Software Configuration Management introduction
Software Configuration Management introductionSoftware Configuration Management introduction
Software Configuration Management introduction
 
Meta Safety Data Sheets for hazardous materials
Meta Safety Data Sheets for hazardous materialsMeta Safety Data Sheets for hazardous materials
Meta Safety Data Sheets for hazardous materials
 
Personnel Protective Equipment along with measures
Personnel Protective Equipment along with measuresPersonnel Protective Equipment along with measures
Personnel Protective Equipment along with measures
 
object oriented testing with types of testing
object oriented testing with types of testingobject oriented testing with types of testing
object oriented testing with types of testing
 

Recently uploaded

What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 

Recently uploaded (20)

What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 

types of testing with descriptions and examples

  • 1. Object Oriented Testing and Test-Driven Development
  • 2. Objectives  To discuss when testing takes place in the life cycle  Test-driven development advocates early testing!  To cover the strategies and tools associated with object oriented testing  Analysis and Design Testing  Class Tests  Integration Tests  Validation Tests  System Tests  To discuss test plans and execution for projects analysis design code test ?
  • 3. Object-Oriented Testing  When should testing begin?  Analysis and Design:  Testing begins by evaluating the OOA and OOD models  How do we test OOA models (requirements and use cases)?  How do we test OOD models (class and sequence diagrams)?  Structured walk-throughs, prototypes  Formal reviews of correctness, completeness and consistency  Programming:  How does OO make testing different from procedural programming?  Concept of a ‘unit’ broadens due to class encapsulation  Integration focuses on classes and their context of a use case scenario or their execution across a thread  Validation may still use conventional black box methods
  • 4. Test-driven programming  eXtreme Programming (XP) advocates writing tests for units before writing actual code for units  Why might this practice be a good idea?  Constrains code to design: How so?  Design -> Test -> Code … in small iterations  Promotes validation and reliability: Why?  Always rerun all tests (easier with automated testing) before integrating new code in a release  Increases confidence to change code: Why?  Changes shouldn’t break old code if you can test old code  Creed of XP: “embrace change”
  • 6. Criteria for Completion of Testing  When are we done testing? (Are we there yet?)  How to answer this question is still a research question 1. One view: testing is never done… the burden simply shifts from the developer to the customer 2. Or: testing is done when you run out of time or money 3. Or use a statistical model:  Assume that errors decay logarithmically with testing time  Measure the number of errors in a unit period  Fit these measurements to a logarithmic curve  Can then say: “with our experimentally valid statistical model we have done sufficient testing to say that with 95% confidence the probability of 1000 CPU hours of failure free operation is at least 0.995”
  • 8. Strategic Issues  Issues for a successful software testing strategy:  Specify product requirements long before testing commences For example: portability, maintainability, usability Do so in a manner that is unambiguous and quantifiable  Understand the users of the software, with use cases  Develop a testing plan that emphasizes “rapid cycle testing” Get quick feedback from a series of small incremental tests  Build robust software that is designed to test itself Use assertions, exception handling and automated testing tools (Junit).  Conduct formal technical reviews to assess test strategy and test cases - “Who watches the watchers?”
  • 9. Testing Analysis and Design  Syntactic correctness:  Are UML and ADT notation used correctly?  Semantic correctness:  Does the model reflect the real world problem?  Is UML used as intended by its designers?  Is the ADT design complete (capturing all the classes and operations in UML diagram) and understandable?  Testing for consistency:  An inconsistent model has representations in one part that are not reflected in other portions of the model
  • 10. Testing the Class Model 1. Revisit the Use Cases, CRC cards and UML class model. Check that all collaborations are properly represented. Inspect the description of each CRC index card to make sure a delegated responsibility is part of the collaborator’s definition.  Example: in a point of sale system.  A read credit card responsibility of a credit sale class is accomplished if satisfied by a credit card collaborator 2. Invert connections to ensure that each collaborator asked for a service is receiving requests from a reasonable source  Example: a credit card being asked for a purchase amount  Have you tested your analysis and design?  If not, who will do it?
  • 11. Testing OO Code Class tests Integration tests Validation tests System tests
  • 12. [1] Class (Unit) Testing  Smallest testable unit is the encapsulated class  Test each operation as part of a class hierarchy because its class hierarchy defines its context of use  Approach:  Test each method (and constructor) within a class  Test the state behavior (attributes) of the class between methods  How is class testing different from conventional testing?  Conventional testing focuses on input-process-output, whereas class testing focuses on each method, then designing sequences of methods to exercise states of a class  But white-box testing can still be applied
  • 13. Class Testing Process class to be tested test cases results software engineer How to test? Why a loop?
  • 14. Class Test Case Design 1. Identify each test case uniquely - Associate test case explicitly with the class and/or method to be tested 2. State the purpose of the test 3. Each test case should contain: a. A list of messages and operations that will be exercised as a consequence of the test b. A list of exceptions that may occur as the object is tested c. A list of external conditions for setup (i.e., changes in the environment external to the software that must exist in order to properly conduct the test) d. Supplementary information that will aid in understanding or implementing the test  Automated unit testing tools facilitate these requirements
  • 15. Challenges of Class Testing  Encapsulation:  Difficult to obtain a snapshot of a class without building extra methods which display the classes’ state  Inheritance and polymorphism:  Each new context of use (subclass) requires re-testing because a method may be implemented differently (polymorphism).  Other unaltered methods within the subclass may use the redefined method and need to be tested  White box tests:  Basis path, condition, data flow and loop tests can all apply to individual methods, but don’t test interactions between methods
  • 16. Random Class Testing 1. Identify methods applicable to a class 2. Define constraints on their use – e.g. the class must always be initialized first 3. Identify a minimum test sequence – an operation sequence that defines the minimum life history of the class 4. Generate a variety of random (but valid) test sequences – this exercises more complex class instance life histories  Example: 1. An account class in a banking application has open, setup, deposit, withdraw, balance, summarize and close methods 2. The account must be opened first and closed on completion 3. Open – setup – deposit – withdraw – close 4. Open – setup – deposit –* [deposit | withdraw | balance | summarize] – withdraw – close. Generate random test sequences using this template
  • 17. [2] Integration Testing  OO does not have a hierarchical control structure so conventional top-down and bottom-up integration tests have little meaning  Integration applied three different incremental strategies:  Thread-based testing: integrates classes required to respond to one input or event  Use-based testing: integrates classes required by one use case  Cluster testing: integrates classes required to demonstrate one collaboration • What integration testing strategies will you use?
  • 18. Random Integration Testing  Multiple Class Random Testing 1. For each client class, use the list of class methods to generate a series of random test sequences. Methods will send messages to other server classes. 2. For each message that is generated, determine the collaborating class and the corresponding method in the server object. 3. For each method in the server object (that has been invoked by messages sent from the client object), determine the messages that it transmits 4. For each of the messages, determine the next level of methods that are invoked and incorporate these into the test sequence
  • 19. [3] Validation Testing  Are we building the right product?  Validation succeeds when software functions in a manner that can be reasonably expected by the customer.  Focus on user-visible actions and user-recognizable outputs  Details of class connections disappear at this level  Apply:  Use-case scenarios from the software requirements spec  Black-box testing to create a deficiency list  Acceptance tests through alpha (at developer’s site) and beta (at customer’s site) testing with actual customers  How will you validate your term product?
  • 21. [4] System Testing  Software may be part of a larger system. This often leads to “finger pointing” by other system dev teams  Finger pointing defence: 1. Design error-handling paths that test external information 2. Conduct a series of tests that simulate bad data 3. Record the results of tests to use as evidence  Types of System Testing:  Recovery testing: how well and quickly does the system recover from faults  Security testing: verify that protection mechanisms built into the system will protect from unauthorized access (hackers, disgruntled employees, fraudsters)  Stress testing: place abnormal load on the system  Performance testing: investigate the run-time performance within the context of an integrated system
  • 23. Testing Summary  Testing affects all stages of software engineering cycle  One strategy is a bottom-up approach – class, integration, validation and system level testing  XP advocates test-driven development: plan tests before you write any code, then test any changes  Other techniques:  white box (look into technical internal details)  black box (view the external behaviour)  debugging (systematic cause elimination approach is best) analysis design code test