SlideShare a Scribd company logo
1 of 23
Download to read offline
Black-box Testing
0 Two main approaches to design black box test cases:
0 Equivalence class partitioning
0 Boundary value analysis
Gurbakash Phonsa
Example
In a computer store, the computer item can have
a quantity between -500 to +500.
Define equivalence classes for above scenario?
Gurbakash Phonsa
Solution
Valid class: -500 <= QTY <= +500
Invalid class: QTY > +500
Invalid class: QTY < -500
Gurbakash Phonsa
Example
Account code can be 500 to 1000 or 0 to 499 or 2000 (the field type is
integer). What are the equivalence classes?
Gurbakash Phonsa
Solution
Valid class: 0 <= account <= 499
Valid class: 500 <= account <= 1000
Valid class: 2000 <= account <= 2000
Invalid class: account < 0
Invalid class: 1000 < account < 2000
Invalid class: account > 2000
Gurbakash Phonsa
Example
Gurbakash Phonsa
Gurbakash Phonsa
Gurbakash Phonsa
White-Box Testing
There exist several popular white-box
testing methodologies:
0 Statement coverage
0 branch coverage
0 path coverage
0 condition coverage
0 mutation testing
0 data flow-based testing
Gurbakash Phonsa
Statement Coverage
Objective:
0 All statements should be executed at least once
Gurbakash Phonsa
Example
0 int f1(int x, int y){
0 1 while (x != y){
0 2 if (x>y) then
0 3 x=x-y;
0 4 else y=y-x;
0 5 }
0 6 return x; }
Gurbakash Phonsa
Statement testing:: Test cases
0By choosing the test set
{(x=3,y=3),(x=4,y=3), (x=3,y=4)}
0All statements are executed at least
once.
Gurbakash Phonsa
Branch Coverage
0Test cases are designed such
that:
0Different branch conditions
0Given true and false values in
turn.
Gurbakash Phonsa
Branch Coverage
0Branch testing guarantees
statement coverage:
0A stronger testing compared to
the statement coverage-based
testing.
Gurbakash Phonsa
Example
int f1(int x,int y){
1 while (x != y){
2 if (x>y) then
3 x=x-y;
4 else y=y-x;
5 }
6 return x; }
Gurbakash Phonsa
Example
0 Test cases for branch coverage can
be:
{(x=3,y=3),(x=3,y=2), (x=4,y=3),
(x=3,y=4)}
Gurbakash Phonsa
Condition Coverage
0 Test cases are designed such that:
0Each component of a composite
conditional expression
0Given both true and false values.
Gurbakash Phonsa
Example
0 Consider the conditional
expression
0((c1.and.c2).or.c3):
0 Each of c1, c2, and c3 are
exercised at least once,
0i.e. given true and false values.
Gurbakash Phonsa
Gurbakash Phonsa
Gurbakash Phonsa
Gurbakash Phonsa

More Related Content

More from Gurbakash Phonsa (9)

Software quality iso-cmm-psp
Software quality  iso-cmm-pspSoftware quality  iso-cmm-psp
Software quality iso-cmm-psp
 
CORBA
CORBACORBA
CORBA
 
Review of object orientation
Review of object orientationReview of object orientation
Review of object orientation
 
SRE Tools
SRE ToolsSRE Tools
SRE Tools
 
SRE Tools
SRE ToolsSRE Tools
SRE Tools
 
Malware and security
Malware and securityMalware and security
Malware and security
 
Time series models iv
Time series models ivTime series models iv
Time series models iv
 
Markov structure models iv
Markov structure models ivMarkov structure models iv
Markov structure models iv
 
Software reliability models error seeding model and failure model-iv
Software reliability models error seeding model and failure model-ivSoftware reliability models error seeding model and failure model-iv
Software reliability models error seeding model and failure model-iv
 

Recently uploaded

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
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
 
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
 

Recently uploaded (20)

Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
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...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
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
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
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
 
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
 

Black box and White box examples