SlideShare uma empresa Scribd logo
1 de 46
Software Testing TechniquesSoftware Testing Techniques
Preeti MishraPreeti Mishra
Course InstructorCourse Instructor
Observations about
Testing
• “Testing is the process of executing a program
with the intention of finding errors.” – Myers
• “Testing can show the presence of bugs but never
their absence.” - Dijkstra
Good Testing Practices
• A good test case is one that has a high probability
of detecting an undiscovered defect, not one that
shows that the program works correctly
• It is impossible to test your own program
• A necessary part of every test case is a
description of the expected result
Software testing axioms
1. It is impossible to test a program completely.
2. Software testing is a risk-based exercise.
3. Testing cannot show the absence of bugs.
4. The more bugs you find, the more bugs there are.
5. Not all bugs found will be fixed.
6. It is difficult to say when a bug is indeed a bug.
7. Specifications are never final.
8. Software testers are not the most popular members of a
project.
9. Software testing is a disciplined and technical profession.
YAHOO!
Characteristics of Testable
Software
• Operable
– The better it works (i.e., better quality), the easier it is to test
• Observable
– Incorrect output is easily identified; internal errors are
automatically detected
• Controllable
– The states and variables of the software can be controlled
directly by the tester
• Decomposable
– The software is built from independent modules that can be
tested independently
Characteristics of Testable
Software (continued)
• Simple
– The program should exhibit functional, structural, and code
simplicity
• Stable
– Changes to the software during testing are infrequent and do
not invalidate existing tests
• Understandable
– The architectural design is well understood; documentation is
available and organized
Test Characteristics
• A good test has a high probability of finding an error
– The tester must understand the software and how it might fail
• A good test is not redundant
– Testing time is limited; one test should not serve the same
purpose as another test
• A good test should be “best of breed”
– Tests that have the highest likelihood of uncovering a whole
class of errors should be used
• A good test should be neither too simple nor too complex
– Each test should be executed separately; combining a series of
tests could cause side effects and mask certain errors
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”
White-box TestingWhite-box Testing
White-box Testing
• Uses the control structure part of component-level design
to derive the test cases
• These test cases
– Guarantee that all independent paths within a module have
been exercised at least once
– Exercise all logical decisions on their true and false sides
– Execute all loops at their boundaries and within their
operational bounds
– Exercise internal data structures to ensure their validity
“Bugs lurk in corners and congregate at boundaries”
Black-box TestingBlack-box Testing
Black-box Testing
• Complements white-box testing by uncovering different
classes of errors
• Focuses on the functional requirements and the information
domain of the software
• Used during the later stages of testing after white box
testing has been performed
• The tester identifies a set of input conditions that will fully
exercise all functional requirements for a program
• The test cases satisfy the following:
– Reduce, by a count greater than one, the number of additional
test cases that must be designed to achieve reasonable testing
– Tell us something about the presence or absence of classes of
errors, rather than an error associated only with the specific
task at hand
Black-box Testing
Categories
• Incorrect or missing functions
• Interface errors
• Errors in data structures or external data base access
• Behavior or performance errors
• Initialization and termination errors
Questions answered by
Black-box Testing
• How is functional validity tested?
• How are system behavior and performance tested?
• What classes of input will make good test cases?
• Is the system particularly sensitive to certain input values?
• How are the boundary values of a data class isolated?
• What data rates and data volume can the system tolerate?
• What effect will specific combinations of data have on
system operation?
Traditional Testing v/sTraditional Testing v/s
Object OrientedObject Oriented
TestingTesting
Levels of Testing
• Testing Levels
• Irrespective of using any software development
paradigm, testing is performed at four important
levels
Unit Testing
• A unit is a smallest testable part of an application.
• In conventional/procedural programming, a unit may be
– an individual program,
– module,
– function,
– procedure
• while in object-oriented programming, the smallest unit
is
– a encapsulated class, which may belong to a base/super class,
abstract class or derived/child class.
Integration Testing
• After the units are individually tested successfully, the
next level of testing i.e integration testing proceeds.
• Integration testing in conventional software
development:
– is to progressively integrate the tested units either
incrementally or non-incrementally, so as to check whether the
software units in an integrated mode are working properly.
• In an object-oriented software development:
– Integrated testing is to verify the interaction among classes
(interclass).
– The relationships among classes are the basic characteristics of
an object-oriented system and define the nature of interaction
among classes and objects
at runtime.
System Testing(Validation Testing)
• Validation testing is followed by integration testing.
Validation testing focuses on user-visible actions and
• It demonstrates conformity with requirements.
• Black-box testing is a testing type used for validation
purpose. Since black-box testing is used for validating the
functionality of software, it is otherwise called as
functional testing.
• Equivalence partitioning and Boundary value analysis are
the two broad categories of black-box testing.
System Testing(Validation Testing)
• There is no distinction among conventional, object-
oriented with respect to validation testing
• System testing verifies that all elements (hardware,
people, databases) are integrated properly so as to ensure
• whether the overall product met its requirement and
achieved the expected performance.
• System testing also deals with non-functional
requirements of the software such as recovery testing,
security testing, stress testing and performance testing.
Object OrientedObject Oriented
TestingTesting
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
Testing OO Code
Class testsClass tests IntegrationIntegration
teststests
ValidationValidation
teststests
SystemSystem
teststests
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
• 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
classclass
to beto be
testedtested
test casestest cases
resultsresults
softwaresoftware
engineerengineer
How to test?How to test?
Why aWhy a
loop?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
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?
Thread based v/s Use based
• Thread-based testing, integrates the set of classes
required to respond to one
• input or event for the system. Each thread is integrated
and tested individually. Regression testing is applied to
ensure that no side effects occur.
• Use-based testing, begins the construction of the system
by testing those classes (called independent classes) that
use very few of server classes.
• After the independent classes are tested,the dependent
classes that use the independent classes are tested. This
sequence of testing layers of dependent
• classes continues until the entire system is constructed
System/ 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?
Object-oriented software testing
problems
 Integration testing may add a large cost (time
resources) to software development process.
 Polymorphism - attribute may have more than one
set of values and an operation may be
implemented by more than one method.
 Inheritance - object may have more than one
super class.
 Encapsulation - information hiding.
Performance TestingPerformance Testing
Introduction
• What is Performance Testing?
• Performance testing, a non-functional testing technique performed to
determine the system parameters in terms of responsiveness and
stability under various workload. Performance testing measures the
quality attributes of the system, such as scalability, reliability and
resource usage.
• Attributes of Performance Testing:
– Speed
– Scalability
– Stability
– reliability
Performance Testing Techniques:
– Load testing - It is the simplest form of testing conducted to understand the
behaviour of the system under a specific load. Load testing will result in measuring
important business critical transactions and load on the database, application server,
etc., are also monitored.
– Stress testing - It is performed to find the upper limit capacity of the system and
also to determine how the system performs if the current load goes well above the
expected maximum.
– Soak testing - Soak Testing also known as endurance testing, is performed to
determine the system parameters under continuous expected load. During soak tests
the parameters such as memory utilization is monitored to detect memory leaks or
other performance issues. The main aim is to discover the system's performance
under sustained use.
– Spike testing - Spike testing is performed by increasing the number of users
suddenly by a very large amount and measuring the performance of the system. The
main aim is to determine whether the system will be able to sustain the workload.
Stress TestingStress Testing
Basics
• Stress testing is a software testing activity that
determines
– the robustness of software by testing beyond the limits
of normal operation.
• Stress testing is particularly important for "mission
critical" software, but is used for all types of
software.
Introduction
• It is a type of non-functional testing.
• It involves testing beyond normal operational capacity, often
to a breaking point, in order to observe the results.
• It is a form of software testing that is used to determine
the stability of a given system.
• It  put  greater emphasis on robustness, availability, and
error handling under a heavy load, rather than on what would
be considered correct behavior under normal circumstances.
• The goals of such tests may be to ensure the software does
not crash in conditions of insufficient computational
resources (such as memory or disk space).
Load test v/s Stress Test
• Stress testing tries to break the system under test by
overwhelming its resources or by taking resources away
from it (in which case it is sometimes called negative
testing). The main purpose of this process is to make sure
that the system fails and recovers gracefully—a quality
known as recoverability.
• Load testing implies a controlled environment moving from
low loads to high.
• Stress testing focuses on more random events, chaos and
unpredictability.
Reason behind Stress Testing
• The software being tested is "mission critical", that is,
failure of the software (such as a crash) would have
disastrous consequences.
• The amount of time and resources dedicated to testing
is usually not sufficient, with traditional testing
methods, to test all of the situations in which the
software will be used when it is released.
Reason behind Stress Testing
• Even with sufficient time and resources for writing
tests, it may not be possible to determine before hand
all of the different ways in which the software will be
used. This is particularly true for operating systems and
middleware, which will eventually be used by software
that doesn't even exist at the time of the testing.
• Customers may use the software on computers that have
significantly fewer computational resources (such as
memory or disk space) than the computers used for
testing.
Reason behind Stress Testing
• Concurrency is particularly difficult to test with
traditional testing methods. Stress testing may be
necessary to find race conditions and deadlocks.
• Software such as web servers that will be accessible
over the Internet may be subject to denial of service
attacks.
• Under normal conditions, certain types of bugs, such as
memory leaks, can be difficult to detect over the short
periods of time in which testing is performed. However,
these bugs can still be potentially serious. In a sense,
stress testing for a relatively short period of time can
be seen as simulating normal operation for a longer
period of time.
Scalability TestingScalability Testing
Introduction
• What is Scalability Testing?
– Scalability, a performance testing parameter that investigates a
system's ability to grow by increasing the workload per user, or the
number of concurrent users, or the size of a database.
• Scalability Testing Attributes:
– Response Time
– Throughput
– Hits per second, Request per seconds, Transaction per seconds
– Performance measurement with number of users
– Performance measurement under huge load
– CPU usage, Memory usage while testing in progress
– Network Usage - data sent and received
– Web server - Request and response per second

Mais conteúdo relacionado

Mais procurados

CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V
pkaviya
 
10 architectural design (1)
10 architectural design (1)10 architectural design (1)
10 architectural design (1)
Ayesha Bhatti
 
Unit 3 3 architectural design
Unit 3 3 architectural designUnit 3 3 architectural design
Unit 3 3 architectural design
Hiren Selani
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Mahesh Bhalerao
 

Mais procurados (20)

Modeling and analysis
Modeling and analysisModeling and analysis
Modeling and analysis
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 
Component level design
Component   level designComponent   level design
Component level design
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
 
Lecture 2 (Software Processes)
Lecture 2 (Software Processes)Lecture 2 (Software Processes)
Lecture 2 (Software Processes)
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V CS8592 Object Oriented Analysis & Design - UNIT V
CS8592 Object Oriented Analysis & Design - UNIT V
 
10 architectural design (1)
10 architectural design (1)10 architectural design (1)
10 architectural design (1)
 
Unit 5
Unit 5Unit 5
Unit 5
 
CS8592-OOAD Lecture Notes Unit-5
CS8592-OOAD Lecture Notes Unit-5 CS8592-OOAD Lecture Notes Unit-5
CS8592-OOAD Lecture Notes Unit-5
 
Requirements analysis lecture
Requirements analysis lectureRequirements analysis lecture
Requirements analysis lecture
 
OOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMSOOAD UNIT I UML DIAGRAMS
OOAD UNIT I UML DIAGRAMS
 
Object Oriented Analysis
Object Oriented AnalysisObject Oriented Analysis
Object Oriented Analysis
 
Unit 3 3 architectural design
Unit 3 3 architectural designUnit 3 3 architectural design
Unit 3 3 architectural design
 
Object model
Object modelObject model
Object model
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
1 introduction of OOAD
1 introduction of OOAD1 introduction of OOAD
1 introduction of OOAD
 
Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
 
Quality attributes in software architecture by Dr.C.R.Dhivyaa, Assistant prof...
Quality attributes in software architecture by Dr.C.R.Dhivyaa, Assistant prof...Quality attributes in software architecture by Dr.C.R.Dhivyaa, Assistant prof...
Quality attributes in software architecture by Dr.C.R.Dhivyaa, Assistant prof...
 
4 sdlc
4 sdlc4 sdlc
4 sdlc
 

Destaque

Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
koolkampus
 
Architectural styles and patterns
Architectural styles and patternsArchitectural styles and patterns
Architectural styles and patterns
Himanshu
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
Chankey Pathak
 

Destaque (10)

Software architecture styles families_research_gssi_nov2013
Software architecture styles families_research_gssi_nov2013Software architecture styles families_research_gssi_nov2013
Software architecture styles families_research_gssi_nov2013
 
Software Architecture Styles
Software Architecture StylesSoftware Architecture Styles
Software Architecture Styles
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
 
Architectural styles and patterns
Architectural styles and patternsArchitectural styles and patterns
Architectural styles and patterns
 
Software Architecture: Styles
Software Architecture: StylesSoftware Architecture: Styles
Software Architecture: Styles
 
ARCHITECTURAL STYLES
ARCHITECTURAL STYLESARCHITECTURAL STYLES
ARCHITECTURAL STYLES
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
 
Software testing ppt
Software testing pptSoftware testing ppt
Software testing ppt
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
 

Semelhante a Software testing part

<p>Software Testing</p>
<p>Software Testing</p><p>Software Testing</p>
<p>Software Testing</p>
Atul Mishra
 
An overview to Software Testing
An overview to Software TestingAn overview to Software Testing
An overview to Software Testing
Atul Mishra
 
Manual Tester Interview Questions(1).pdf
Manual Tester Interview Questions(1).pdfManual Tester Interview Questions(1).pdf
Manual Tester Interview Questions(1).pdf
SupriyaDongare
 

Semelhante a Software testing part (20)

Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit design
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tactics
 
Software Testing Strategies
Software Testing StrategiesSoftware Testing Strategies
Software Testing Strategies
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
 
Object Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesObject Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slides
 
Software Quality Assurance
Software Quality AssuranceSoftware Quality Assurance
Software Quality Assurance
 
Testing strategies part -1
Testing strategies part -1Testing strategies part -1
Testing strategies part -1
 
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
 
Quality assurance tests
Quality assurance testsQuality assurance tests
Quality assurance tests
 
<p>Software Testing</p>
<p>Software Testing</p><p>Software Testing</p>
<p>Software Testing</p>
 
An overview to Software Testing
An overview to Software TestingAn overview to Software Testing
An overview to Software Testing
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Week 14 Unit Testing.pptx
Week 14  Unit Testing.pptxWeek 14  Unit Testing.pptx
Week 14 Unit Testing.pptx
 
Software testing
Software testingSoftware testing
Software testing
 
G53 qat09pdf6up
G53 qat09pdf6upG53 qat09pdf6up
G53 qat09pdf6up
 
Lect-6-Generic testing types.pptx
Lect-6-Generic testing types.pptxLect-6-Generic testing types.pptx
Lect-6-Generic testing types.pptx
 
Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--
 
Unit iv-testing-pune-university-sres-coe
Unit iv-testing-pune-university-sres-coeUnit iv-testing-pune-university-sres-coe
Unit iv-testing-pune-university-sres-coe
 
Software Engineering (Testing Overview)
Software Engineering (Testing Overview)Software Engineering (Testing Overview)
Software Engineering (Testing Overview)
 
Manual Tester Interview Questions(1).pdf
Manual Tester Interview Questions(1).pdfManual Tester Interview Questions(1).pdf
Manual Tester Interview Questions(1).pdf
 

Mais de Preeti Mishra

Mais de Preeti Mishra (20)

Effective Ways to Conduct Programming labs
Effective Ways to Conduct Programming labsEffective Ways to Conduct Programming labs
Effective Ways to Conduct Programming labs
 
Uml intro
Uml introUml intro
Uml intro
 
Component diagram
Component diagramComponent diagram
Component diagram
 
Activity diag
Activity diagActivity diag
Activity diag
 
Object diagram
Object diagramObject diagram
Object diagram
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
State chart diagram
State chart diagramState chart diagram
State chart diagram
 
Use case Diagram
Use case DiagramUse case Diagram
Use case Diagram
 
Unit 8 software quality and matrices
Unit 8 software quality and matricesUnit 8 software quality and matrices
Unit 8 software quality and matrices
 
Oo concepts and class modeling
Oo concepts and class modelingOo concepts and class modeling
Oo concepts and class modeling
 
Unit 7 performing user interface design
Unit 7 performing user interface designUnit 7 performing user interface design
Unit 7 performing user interface design
 
requirements analysis and design
requirements analysis and designrequirements analysis and design
requirements analysis and design
 
Design process interaction design basics
Design process interaction design basicsDesign process interaction design basics
Design process interaction design basics
 
Design process design rules
Design process  design rulesDesign process  design rules
Design process design rules
 
Design process evaluating interactive_designs
Design process  evaluating interactive_designsDesign process  evaluating interactive_designs
Design process evaluating interactive_designs
 
Foundations understanding users and interactions
Foundations  understanding users and interactionsFoundations  understanding users and interactions
Foundations understanding users and interactions
 
IntrIntroduction
IntrIntroductionIntrIntroduction
IntrIntroduction
 
Coupling coheshion tps
Coupling coheshion tpsCoupling coheshion tps
Coupling coheshion tps
 
Analysis
AnalysisAnalysis
Analysis
 
Dynamic modeling
Dynamic modelingDynamic modeling
Dynamic modeling
 

Último

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 

Último (20)

Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 

Software testing part

  • 1. Software Testing TechniquesSoftware Testing Techniques Preeti MishraPreeti Mishra Course InstructorCourse Instructor
  • 2. Observations about Testing • “Testing is the process of executing a program with the intention of finding errors.” – Myers • “Testing can show the presence of bugs but never their absence.” - Dijkstra
  • 3. Good Testing Practices • A good test case is one that has a high probability of detecting an undiscovered defect, not one that shows that the program works correctly • It is impossible to test your own program • A necessary part of every test case is a description of the expected result
  • 4. Software testing axioms 1. It is impossible to test a program completely. 2. Software testing is a risk-based exercise. 3. Testing cannot show the absence of bugs. 4. The more bugs you find, the more bugs there are. 5. Not all bugs found will be fixed. 6. It is difficult to say when a bug is indeed a bug. 7. Specifications are never final. 8. Software testers are not the most popular members of a project. 9. Software testing is a disciplined and technical profession.
  • 6. Characteristics of Testable Software • Operable – The better it works (i.e., better quality), the easier it is to test • Observable – Incorrect output is easily identified; internal errors are automatically detected • Controllable – The states and variables of the software can be controlled directly by the tester • Decomposable – The software is built from independent modules that can be tested independently
  • 7. Characteristics of Testable Software (continued) • Simple – The program should exhibit functional, structural, and code simplicity • Stable – Changes to the software during testing are infrequent and do not invalidate existing tests • Understandable – The architectural design is well understood; documentation is available and organized
  • 8. Test Characteristics • A good test has a high probability of finding an error – The tester must understand the software and how it might fail • A good test is not redundant – Testing time is limited; one test should not serve the same purpose as another test • A good test should be “best of breed” – Tests that have the highest likelihood of uncovering a whole class of errors should be used • A good test should be neither too simple nor too complex – Each test should be executed separately; combining a series of tests could cause side effects and mask certain errors
  • 9. 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”
  • 11. White-box Testing • Uses the control structure part of component-level design to derive the test cases • These test cases – Guarantee that all independent paths within a module have been exercised at least once – Exercise all logical decisions on their true and false sides – Execute all loops at their boundaries and within their operational bounds – Exercise internal data structures to ensure their validity “Bugs lurk in corners and congregate at boundaries”
  • 13. Black-box Testing • Complements white-box testing by uncovering different classes of errors • Focuses on the functional requirements and the information domain of the software • Used during the later stages of testing after white box testing has been performed • The tester identifies a set of input conditions that will fully exercise all functional requirements for a program • The test cases satisfy the following: – Reduce, by a count greater than one, the number of additional test cases that must be designed to achieve reasonable testing – Tell us something about the presence or absence of classes of errors, rather than an error associated only with the specific task at hand
  • 14. Black-box Testing Categories • Incorrect or missing functions • Interface errors • Errors in data structures or external data base access • Behavior or performance errors • Initialization and termination errors
  • 15. Questions answered by Black-box Testing • How is functional validity tested? • How are system behavior and performance tested? • What classes of input will make good test cases? • Is the system particularly sensitive to certain input values? • How are the boundary values of a data class isolated? • What data rates and data volume can the system tolerate? • What effect will specific combinations of data have on system operation?
  • 16. Traditional Testing v/sTraditional Testing v/s Object OrientedObject Oriented TestingTesting
  • 17. Levels of Testing • Testing Levels • Irrespective of using any software development paradigm, testing is performed at four important levels
  • 18. Unit Testing • A unit is a smallest testable part of an application. • In conventional/procedural programming, a unit may be – an individual program, – module, – function, – procedure • while in object-oriented programming, the smallest unit is – a encapsulated class, which may belong to a base/super class, abstract class or derived/child class.
  • 19. Integration Testing • After the units are individually tested successfully, the next level of testing i.e integration testing proceeds. • Integration testing in conventional software development: – is to progressively integrate the tested units either incrementally or non-incrementally, so as to check whether the software units in an integrated mode are working properly. • In an object-oriented software development: – Integrated testing is to verify the interaction among classes (interclass). – The relationships among classes are the basic characteristics of an object-oriented system and define the nature of interaction among classes and objects at runtime.
  • 20. System Testing(Validation Testing) • Validation testing is followed by integration testing. Validation testing focuses on user-visible actions and • It demonstrates conformity with requirements. • Black-box testing is a testing type used for validation purpose. Since black-box testing is used for validating the functionality of software, it is otherwise called as functional testing. • Equivalence partitioning and Boundary value analysis are the two broad categories of black-box testing.
  • 21. System Testing(Validation Testing) • There is no distinction among conventional, object- oriented with respect to validation testing • System testing verifies that all elements (hardware, people, databases) are integrated properly so as to ensure • whether the overall product met its requirement and achieved the expected performance. • System testing also deals with non-functional requirements of the software such as recovery testing, security testing, stress testing and performance testing.
  • 22.
  • 24. 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
  • 25. Testing OO Code Class testsClass tests IntegrationIntegration teststests ValidationValidation teststests SystemSystem teststests
  • 26. 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 • 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
  • 27. Class Testing Process classclass to beto be testedtested test casestest cases resultsresults softwaresoftware engineerengineer How to test?How to test? Why aWhy a loop?loop?
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. 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?
  • 32. Thread based v/s Use based • Thread-based testing, integrates the set of classes required to respond to one • input or event for the system. Each thread is integrated and tested individually. Regression testing is applied to ensure that no side effects occur. • Use-based testing, begins the construction of the system by testing those classes (called independent classes) that use very few of server classes. • After the independent classes are tested,the dependent classes that use the independent classes are tested. This sequence of testing layers of dependent • classes continues until the entire system is constructed
  • 33. System/ 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?
  • 34. Object-oriented software testing problems  Integration testing may add a large cost (time resources) to software development process.  Polymorphism - attribute may have more than one set of values and an operation may be implemented by more than one method.  Inheritance - object may have more than one super class.  Encapsulation - information hiding.
  • 36. Introduction • What is Performance Testing? • Performance testing, a non-functional testing technique performed to determine the system parameters in terms of responsiveness and stability under various workload. Performance testing measures the quality attributes of the system, such as scalability, reliability and resource usage. • Attributes of Performance Testing: – Speed – Scalability – Stability – reliability
  • 37. Performance Testing Techniques: – Load testing - It is the simplest form of testing conducted to understand the behaviour of the system under a specific load. Load testing will result in measuring important business critical transactions and load on the database, application server, etc., are also monitored. – Stress testing - It is performed to find the upper limit capacity of the system and also to determine how the system performs if the current load goes well above the expected maximum. – Soak testing - Soak Testing also known as endurance testing, is performed to determine the system parameters under continuous expected load. During soak tests the parameters such as memory utilization is monitored to detect memory leaks or other performance issues. The main aim is to discover the system's performance under sustained use. – Spike testing - Spike testing is performed by increasing the number of users suddenly by a very large amount and measuring the performance of the system. The main aim is to determine whether the system will be able to sustain the workload.
  • 39. Basics • Stress testing is a software testing activity that determines – the robustness of software by testing beyond the limits of normal operation. • Stress testing is particularly important for "mission critical" software, but is used for all types of software.
  • 40. Introduction • It is a type of non-functional testing. • It involves testing beyond normal operational capacity, often to a breaking point, in order to observe the results. • It is a form of software testing that is used to determine the stability of a given system. • It  put  greater emphasis on robustness, availability, and error handling under a heavy load, rather than on what would be considered correct behavior under normal circumstances. • The goals of such tests may be to ensure the software does not crash in conditions of insufficient computational resources (such as memory or disk space).
  • 41. Load test v/s Stress Test • Stress testing tries to break the system under test by overwhelming its resources or by taking resources away from it (in which case it is sometimes called negative testing). The main purpose of this process is to make sure that the system fails and recovers gracefully—a quality known as recoverability. • Load testing implies a controlled environment moving from low loads to high. • Stress testing focuses on more random events, chaos and unpredictability.
  • 42. Reason behind Stress Testing • The software being tested is "mission critical", that is, failure of the software (such as a crash) would have disastrous consequences. • The amount of time and resources dedicated to testing is usually not sufficient, with traditional testing methods, to test all of the situations in which the software will be used when it is released.
  • 43. Reason behind Stress Testing • Even with sufficient time and resources for writing tests, it may not be possible to determine before hand all of the different ways in which the software will be used. This is particularly true for operating systems and middleware, which will eventually be used by software that doesn't even exist at the time of the testing. • Customers may use the software on computers that have significantly fewer computational resources (such as memory or disk space) than the computers used for testing.
  • 44. Reason behind Stress Testing • Concurrency is particularly difficult to test with traditional testing methods. Stress testing may be necessary to find race conditions and deadlocks. • Software such as web servers that will be accessible over the Internet may be subject to denial of service attacks. • Under normal conditions, certain types of bugs, such as memory leaks, can be difficult to detect over the short periods of time in which testing is performed. However, these bugs can still be potentially serious. In a sense, stress testing for a relatively short period of time can be seen as simulating normal operation for a longer period of time.
  • 46. Introduction • What is Scalability Testing? – Scalability, a performance testing parameter that investigates a system's ability to grow by increasing the workload per user, or the number of concurrent users, or the size of a database. • Scalability Testing Attributes: – Response Time – Throughput – Hits per second, Request per seconds, Transaction per seconds – Performance measurement with number of users – Performance measurement under huge load – CPU usage, Memory usage while testing in progress – Network Usage - data sent and received – Web server - Request and response per second