SlideShare a Scribd company logo
1 of 43
Black Box Testing
Sources:
Code Complete, 2nd Ed., Steve McConnell
Software Engineering, 5th Ed., Roger Pressman
Testing Computer Software, 2nd Ed., Cem Kaner, et. Al.
Black Box Testing
•
Testing software against a specification of its external behavior without
knowledge of internal implementation details
– Can be applied to software “units” (e.g., classes) or to entire
programs
– External behavior is defined in API docs, Functional specs,
Requirements specs, etc.
•
Because black box testing purposely disregards the program's control
structure, attention is focused primarily on the information domain (i.e.,
data that goes in, data that comes out)
•
The Goal: Derive sets of input conditions (test cases) that fully exercise
the external functionality
Black Box Testing
•
Black box testing tends to find different kinds of errors than white box testing
– Missing functions
– Usability problems
– Performance problems
– Concurrency and timing errors
– Initialization and termination errors
– Etc.
•
Unlike white box testing, black box testing tends to be applied later in the
development process
•
Black Box Testing Example #1
The Information Domain:
inputs and outputs•
Inputs
– Individual input values
•
Try many different values for each individual input
– Combinations of inputs
•
Individual inputs are not independent from each other
•
Programs process multiple input values together, not just one at a time
•
Try many different combinations of inputs in order to achieve good
coverage of the input domain
•
Vary more than one input at a time to more completely cover the input
domain
The Information Domain:
inputs and outputs
•
Inputs (continued)
– Ordering and Timing of inputs
– In addition to the particular combination of input values chosen,
the ordering and timing of the inputs can also make a difference
•
Outputs
– In addition to covering the input domain, make sure your tests
thoroughly cover the output domain
– What are the legal output values?
– Is it possible to select inputs that produce invalid outputs?
The Information Domain:
inputs and outputs
•
Defining the input domain
– Boolean value
•
T or F
– Numeric value in a particular range
•
99 <= N <= 99
•
Integer, Floating point
– One of a fixed set of enumerated values
•
{Jan, Feb, Mar, …}
•
{Visa, MasterCard, Discover, …}
– Formatted strings
•
Phone numbers
•
File names
•
URLs
•
Credit card numbers
•
Regular expressions
Equivalence Partitioning
•
Consider all of the possible values for a single input (i.e., the input's
domain)
•
Frequently the domain is so large that you can't test all possible values
•
You have to select a relatively small number of values to actually test
•
Which values should you choose?
•
Equivalence partitioning helps answer this question
Equivalence Partitioning
•
Partition the input's domain into "equivalence classes"
•
Each equivalence class contains a set of "equivalent" values
•
Two values are considered to be equivalent if we expect the program
to process them both in the same way
•
If you expect the program to process two values in the same way, only
test one of them, thus reducing the number of test cases you have to
run
ValidInvalid
Equivalence Partitioning
•
First-level partitioning: Valid vs. Invalid values
ValidInvalid
Equivalence Partitioning
•
Partition valid and invalid values into equivalence classes
ValidInvalid
Equivalence Partitioning
•
Create a test case for at least one value from each equivalence class
Equivalence Partitioning
•
Equivalence classes can overlap
•
If an oracle is available, the test values in each equivalence class can
be randomly generated. This is more useful than always testing the
same static values.
– Oracle: something that can tell you whether a test passed or
failed
•
Test multiple values in each equivalence class. Often you’re not sure
if you have defined the equivalence classes correctly or completely,
and testing multiple values in each class is more thorough than
relying on a single value.
Equivalence Partitioning - examples
Input Valid Equivalence Classes Invalid Equivalence Classes
A integer N such that:
-99 <= N <= 99
? ?
Phone Number
Area code: [200, 999]
Prefix: (200, 999]
Suffix: Any 4 digits
? ?
Equivalence Partitioning - examples
Input Valid Equivalence Classes Invalid Equivalence Classes
A integer N such that:
-99 <= N <= 99
[-99, -10]
[-9, -1]
0
[1, 9]
[10, 99]
?
Phone Number
Area code: [200, 999]
Prefix: (200, 999]
Suffix: Any 4 digits
? ?
Equivalence Partitioning - examples
Input Valid Equivalence Classes Invalid Equivalence Classes
A integer N such that:
-99 <= N <= 99
[-99, -10]
[-9, -1]
0
[1, 9]
[10, 99]
< -99
> 99
Malformed numbers
{12-, 1-2-3, …}
Non-numeric strings
{junk, 1E2, $13}
Empty value
Phone Number
Area code: [200, 999]
Prefix: (200, 999]
Suffix: Any 4 digits
? ?
Equivalence Partitioning - examples
Input Valid Equivalence Classes Invalid Equivalence Classes
A integer N such that:
-99 <= N <= 99
[-99, -10]
[-9, -1]
0
[1, 9]
[10, 99]
< -99
> 99
Malformed numbers
{12-, 1-2-3, …}
Non-numeric strings
{junk, 1E2, $13}
Empty value
Phone Number
Area code: [200, 999]
Prefix: (200, 999]
Suffix: Any 4 digits
555-5555
(555)555-5555
555-555-5555
200 <= Area code <= 999
200 < Prefix <= 999
?
Equivalence Partitioning - examples
Input Valid Equivalence Classes Invalid Equivalence Classes
A integer N such that:
-99 <= N <= 99
[-99, -10]
[-9, -1]
0
[1, 9]
[10, 99]
< -99
> 99
Malformed numbers
{12-, 1-2-3, …}
Non-numeric strings
{junk, 1E2, $13}
Empty value
Phone Number
Area code: [200, 999]
Prefix: (200, 999]
Suffix: Any 4 digits
555-5555
(555)555-5555
555-555-5555
200 <= Area code <= 999
200 < Prefix <= 999
Invalid format 5555555,
(555)(555)5555, etc.
Area code < 200 or > 999
Area code with non-numeric
characters
Similar for Prefix and Suffix
Boundary Value Analysis
•
When choosing values from an equivalence class to test, use the values that
are most likely to cause the program to fail
•
Errors tend to occur at the boundaries of equivalence classes rather than at the
"center"
– If (200 < areaCode && areaCode < 999) { // valid area code }
– Wrong!
– If (200 <= areaCode && areaCode <= 999) { // valid area code }
– Testing area codes 200 and 999 would catch this error, but a center value
like 770 would not
•
In addition to testing center values, we should also test boundary values
– Right on a boundary
– Very close to a boundary on either side
ValidInvalid
Boundary Value Analysis
•
Create test cases to test boundaries of equivalence classes
Boundary Value Analysis - examples
Input Boundary Cases
A number N such that:
-99 <= N <= 99
?
Phone Number
Area code: [200, 999]
Prefix: (200, 999]
Suffix: Any 4 digits
?
Boundary Value Analysis - examples
Input Boundary Cases
A number N such that:
-99 <= N <= 99
-100, -99, -98
-10, -9
-1, 0, 1
9, 10
98, 99, 100
Phone Number
Area code: [200, 999]
Prefix: (200, 999]
Suffix: Any 4 digits
?
Boundary Value Analysis - examples
Input Boundary Cases
A number N such that:
-99 <= N <= 99
-100, -99, -98
-10, -9
-1, 0, 1
9, 10
98, 99, 100
Phone Number
Area code: [200, 999]
Prefix: (200, 999]
Suffix: Any 4 digits
Area code: 199, 200, 201
Area code: 998, 999, 1000
Prefix: 200, 199, 198
Prefix: 998, 999, 1000
Suffix: 3 digits, 5 digits
Boundary Value Analysis - examples
•
Numeric values are often entered as strings which are then converted to
numbers internally [int x = atoi(str);]
•
This conversion requires the program to distinguish between digits and
non-digits
•
A boundary case to consider: Will the program accept / and : as digits?
/ 0 1 2 3 4 5 6 7 8 9 :
47 48 49 50 51 52 53 54 55 56 57 58
Char
ASCII
Testing combinations of inputs
•
Equivalence Partitioning and Boundary Value Analysis are performed
on each individual input, resulting in a set of test values for each input
– TV1 = set of test values for Input 1
– TV2 = set of test values for Input 2
– Etc.
•
Beyond testing individual inputs, we must also consider input
combinations
Testing combinations of inputs
•
Suppose there are 3 inputs
•
An input combination is a 3-tuple (tv1, tv2, tv3)
– where tv1 ∈ TV1, tv2 ∈ TV2, tv3 ∈ TV3
•
Test as many different combinations as possible
•
Avoid testing redundant combinations (ones that follow the same path thru the
code)
•
Vary multiple inputs at once to better cover the input domain
X X
TV1 TV2 TV3
Testing combinations of inputs
•
Rather than analyzing each input individually, it often makes sense to
do EP and BVA on multiple inputs together
•
If two or more inputs interact heavily with each other, effective testing
often requires their values to be selected together
•
In this case, each “test value” is actually a tuple of values
•
Example: Substring Search (solution)
(a1,b1,c1)
(a2,b2,c2)
Mainstream usage testing
•
Don't get so wrapped up in testing boundary cases that you neglect to
test "normal" input values
– Values that users would typically enter during mainstream usage
More black box testing examples
•
Black Box Example #2
•
Black Box Example #3
Error Guessing
•
Based on intuition, guess what kinds of inputs might cause the
program to fail
•
Create some test cases based on your guesses
•
Intuition will often lead you toward boundary cases, but not always
•
Some special cases aren't boundary values, but are mishandled by
many programs
– Try exiting the program while it's still starting up
– Try loading a corrupted file
– Try strange but legal URLs: hTtP://Www.bYu.EDU/
State Transition testing
•
Every interactive program has user
observable states
– What screen the user is on
– What information is displayed
to the user
– What actions the user is
allowed to perform
•
User observable states are often
modeled using a screen flow
diagram that shows how users can
move from screen to screen
State Transition testing
•
Ideally, you will test all of the different paths that a user may follow to reach
each screen, and ensure that the program is always in the correct state
– Example: Test all of the different paths for reaching the “Order
Confirmation" screen on an e-commerce web site. Can you trick the
software into letting you submit an order without entering payment
information?
•
It's not only where you are, but also how you got there
Comparison Testing
•
Also called Back-to-Back testing
•
If you have multiple implementations of the same functionality, you can run
test inputs through both implementations, and compare the results for equality
•
Why would you have access to multiple implementations?
– Safety-critical systems sometimes use multiple, independent
implementations of critical modules to ensure the accuracy of results
– You might use a competitor's product, or an earlier version of your own,
as the second implementation
– You might write a software simulation of a new chip that serves as the
specification to the hardware designers. After building the chip, you
could compare the results computed by the chip hardware with the results
computed by the software simulator
•
Inputs may be randomly generated or designed manually
Testing for race conditions and other
timing dependencies
•
Many systems perform multiple concurrent activities
– Operating systems manage concurrent programs, interrupts, etc.
– Servers service many clients simultaneously
– Applications let users perform multiple concurrent actions
•
Test a variety of different concurrency scenarios, focusing on activities that
are likely to share resources (and therefore conflict)
•
"Race conditions" are bugs that occur only when concurrent activities
interleave in particular ways, thus making them difficult to reproduce
•
Test on hardware of various speeds to ensure that your system works well on
both slower and faster machines
Performance Testing
•
Measure the system's performance
– Running times of various tasks
– Memory usage, including memory leaks
– Network usage (Does it consume too much bandwidth? Does it
open too many connections?)
– Disk usage (Is the disk footprint reasonable? Does it clean up
temporary files properly?)
– Process/thread priorities (Does it play well with other applications,
or does it hog the whole machine?)
Limit Testing
•
Test the system at the limits of normal use
•
Test every limit on the program's behavior defined in the requirements
– Maximum number of concurrent users or connections
– Maximum number of open files
– Maximum request size
– Maximum file size
– Etc.
•
What happens when you go slightly beyond the specified limits?
– Does the system's performance degrade dramatically, or gracefully?
Stress Testing
•
Test the system under extreme conditions (i.e., beyond the limits of normal use)
•
Create test cases that demand resources in abnormal quantity, frequency, or
volume
– Low memory conditions
– Disk faults (read/write failures, full disk, file corruption, etc.)
– Network faults
– Unusually high number of requests
– Unusually large requests or files
– Unusually high data rates (what happens if the network suddenly becomes
ten times faster?)
•
Even if the system doesn't need to work in such extreme conditions, stress testing
is an excellent way to find bugs
Random Testing
•
Randomly generate test inputs
– Could be based on some statistical model
•
How do you tell if the test case succeeded?
– Where do the expected results come from?
– Some type of “oracle” is needed
•
Expected results could be calculated manually
– Possible, but lots of work
•
Automated oracles can often be created to measure characteristics of the system
– Performance (memory usage, bandwidth, running times, etc.)
– Did the system crash?
– Maximum and average user response time under simulated user load
Security Testing
•
Any system that manages sensitive information or performs sensitive
functions may become a target for intrusion (i.e., hackers)
•
How feasible is it to break into the system?
•
Learn the techniques used by hackers
•
Try whatever attacks you can think of
•
Hire a security expert to break into the system
•
If somebody broke in, what damage could they do?
•
If an authorized user became disgruntled, what damage could they do?
Usability Testing
•
Is the user interface intuitive, easy to use, organized, logical?
•
Does it frustrate users?
•
Are common tasks simple to do?
•
Does it conform to platform-specific conventions?
•
Get real users to sit down and use the software to perform some tasks
•
Watch them performing the tasks, noting things that seem to give them
trouble
•
Get their feedback on the user interface and any suggested
improvements
•
Report bugs for any problems encountered
Recovery Testing
•
Try turning the power off or otherwise crashing the program at arbitrary
points during its execution
– Does the program come back up correctly when you restart it?
– Was the program’s persistent data corrupted (files, databases, etc.)?
– Was the extent of user data loss within acceptable limits?
•
Can the program recover if its configuration files have been corrupted
or deleted?
•
What about hardware failures? Does the system need to keep working
when its hardware fails? If so, verify that it does so.
Configuration Testing
•
Test on all required hardware configurations
– CPU, memory, disk, graphics card, network card, etc.
•
Test on all required operating systems and versions thereof
– Virtualization technologies such as VMWare and Virtual PC are
very helpful for this
•
Test as many Hardware/OS combinations as you can
•
Test installation programs and procedures on all relevant
configurations
Compatibility Testing
•
Test to make sure the program is compatible with other programs it is
supposed to work with
•
Ex: Can Word 12.0 load files created with Word 11.0?
•
Ex: "Save As… Word, Word Perfect, PDF, HTML, Plain Text"
•
Ex: "This program is compatible with Internet Explorer and Firefox"
•
Test all compatibility requirements
Documentation Testing
•
Test all instructions given in the documentation to ensure their
completeness and accuracy
•
For example, “How To ...” instructions are sometimes not updated to
reflect changes in the user interface
•
Test user documentation on real users to ensure it is clear and
complete

More Related Content

Viewers also liked

Practica de word primer bimestre
Practica de word primer bimestrePractica de word primer bimestre
Practica de word primer bimestre
angelitoutpl123
 
Lee y aprende
Lee y aprendeLee y aprende
Lee y aprende
kamay
 
Loquelosmaestrosnoseatrevenadecir
LoquelosmaestrosnoseatrevenadecirLoquelosmaestrosnoseatrevenadecir
Loquelosmaestrosnoseatrevenadecir
kamay
 
FINAL DRAFT LIVING SKILLS PROGRAM APY
FINAL DRAFT LIVING SKILLS PROGRAM APYFINAL DRAFT LIVING SKILLS PROGRAM APY
FINAL DRAFT LIVING SKILLS PROGRAM APY
Emmanuelle Barone
 
Fotos curiosas
Fotos curiosasFotos curiosas
Fotos curiosas
kamay
 
L02 kompjuteri200
L02 kompjuteri200L02 kompjuteri200
L02 kompjuteri200
stiunada
 
2. pokok masalah
2. pokok masalah2. pokok masalah
2. pokok masalah
dianprim
 
Ipod+
Ipod+Ipod+
Ipod+
tzk
 
Anexo 2, plan_estrategico__2007-2011
Anexo 2, plan_estrategico__2007-2011Anexo 2, plan_estrategico__2007-2011
Anexo 2, plan_estrategico__2007-2011
achong1
 

Viewers also liked (20)

Boundary value analysis
Boundary value analysisBoundary value analysis
Boundary value analysis
 
Practica de word primer bimestre
Practica de word primer bimestrePractica de word primer bimestre
Practica de word primer bimestre
 
Actividad inicial grupo2071027
Actividad inicial grupo2071027Actividad inicial grupo2071027
Actividad inicial grupo2071027
 
Práctica de word romero
Práctica  de  word  romeroPráctica  de  word  romero
Práctica de word romero
 
Lee y aprende
Lee y aprendeLee y aprende
Lee y aprende
 
Team Leader
Team LeaderTeam Leader
Team Leader
 
Infor pack!!
Infor pack!!Infor pack!!
Infor pack!!
 
Hamburg
HamburgHamburg
Hamburg
 
Loquelosmaestrosnoseatrevenadecir
LoquelosmaestrosnoseatrevenadecirLoquelosmaestrosnoseatrevenadecir
Loquelosmaestrosnoseatrevenadecir
 
FINAL DRAFT LIVING SKILLS PROGRAM APY
FINAL DRAFT LIVING SKILLS PROGRAM APYFINAL DRAFT LIVING SKILLS PROGRAM APY
FINAL DRAFT LIVING SKILLS PROGRAM APY
 
Fotos curiosas
Fotos curiosasFotos curiosas
Fotos curiosas
 
Plantilla diseno industrial_y_de_servicios
Plantilla diseno industrial_y_de_serviciosPlantilla diseno industrial_y_de_servicios
Plantilla diseno industrial_y_de_servicios
 
L02 kompjuteri200
L02 kompjuteri200L02 kompjuteri200
L02 kompjuteri200
 
2. pokok masalah
2. pokok masalah2. pokok masalah
2. pokok masalah
 
Chapter 8 software testing
Chapter 8 software testingChapter 8 software testing
Chapter 8 software testing
 
Celia
CeliaCelia
Celia
 
Ipod+
Ipod+Ipod+
Ipod+
 
Anexo 2, plan_estrategico__2007-2011
Anexo 2, plan_estrategico__2007-2011Anexo 2, plan_estrategico__2007-2011
Anexo 2, plan_estrategico__2007-2011
 
Video
VideoVideo
Video
 
Dunkle Sonne, Lesungsprototyp, Kapitel 4
Dunkle Sonne, Lesungsprototyp, Kapitel 4Dunkle Sonne, Lesungsprototyp, Kapitel 4
Dunkle Sonne, Lesungsprototyp, Kapitel 4
 

Similar to Black boxtesting

Similar to Black boxtesting (20)

black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdf
 
Testing foundations
Testing foundationsTesting foundations
Testing foundations
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
AutoTest.ppt
AutoTest.pptAutoTest.ppt
AutoTest.ppt
 
Dynamic Testing
Dynamic TestingDynamic Testing
Dynamic Testing
 
Software Testing - Test Design Techniques
Software Testing - Test Design TechniquesSoftware Testing - Test Design Techniques
Software Testing - Test Design Techniques
 
Unit Testing a Primer
Unit Testing a PrimerUnit Testing a Primer
Unit Testing a Primer
 
G53 qat09pdf6up
G53 qat09pdf6upG53 qat09pdf6up
G53 qat09pdf6up
 
Equivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysisEquivalence partinioning and boundary value analysis
Equivalence partinioning and boundary value analysis
 
Unit 2 Unit level testing.ppt
Unit 2 Unit level testing.pptUnit 2 Unit level testing.ppt
Unit 2 Unit level testing.ppt
 
st_unit_2.ppt
st_unit_2.pptst_unit_2.ppt
st_unit_2.ppt
 
Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)Software Testing Introduction (Part 2)
Software Testing Introduction (Part 2)
 
Class9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdfClass9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdf
 
Black box software testing
Black box software testingBlack box software testing
Black box software testing
 
Key Test Design Techniques
Key Test Design TechniquesKey Test Design Techniques
Key Test Design Techniques
 
Unit 2 - Test Case Design
Unit 2 - Test Case DesignUnit 2 - Test Case Design
Unit 2 - Test Case Design
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
SE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptxSE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptx
 
CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4
 

Recently uploaded

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Recently uploaded (20)

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
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
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 

Black boxtesting

  • 1. Black Box Testing Sources: Code Complete, 2nd Ed., Steve McConnell Software Engineering, 5th Ed., Roger Pressman Testing Computer Software, 2nd Ed., Cem Kaner, et. Al.
  • 2. Black Box Testing • Testing software against a specification of its external behavior without knowledge of internal implementation details – Can be applied to software “units” (e.g., classes) or to entire programs – External behavior is defined in API docs, Functional specs, Requirements specs, etc. • Because black box testing purposely disregards the program's control structure, attention is focused primarily on the information domain (i.e., data that goes in, data that comes out) • The Goal: Derive sets of input conditions (test cases) that fully exercise the external functionality
  • 3. Black Box Testing • Black box testing tends to find different kinds of errors than white box testing – Missing functions – Usability problems – Performance problems – Concurrency and timing errors – Initialization and termination errors – Etc. • Unlike white box testing, black box testing tends to be applied later in the development process • Black Box Testing Example #1
  • 4. The Information Domain: inputs and outputs• Inputs – Individual input values • Try many different values for each individual input – Combinations of inputs • Individual inputs are not independent from each other • Programs process multiple input values together, not just one at a time • Try many different combinations of inputs in order to achieve good coverage of the input domain • Vary more than one input at a time to more completely cover the input domain
  • 5. The Information Domain: inputs and outputs • Inputs (continued) – Ordering and Timing of inputs – In addition to the particular combination of input values chosen, the ordering and timing of the inputs can also make a difference • Outputs – In addition to covering the input domain, make sure your tests thoroughly cover the output domain – What are the legal output values? – Is it possible to select inputs that produce invalid outputs?
  • 6. The Information Domain: inputs and outputs • Defining the input domain – Boolean value • T or F – Numeric value in a particular range • 99 <= N <= 99 • Integer, Floating point – One of a fixed set of enumerated values • {Jan, Feb, Mar, …} • {Visa, MasterCard, Discover, …} – Formatted strings • Phone numbers • File names • URLs • Credit card numbers • Regular expressions
  • 7. Equivalence Partitioning • Consider all of the possible values for a single input (i.e., the input's domain) • Frequently the domain is so large that you can't test all possible values • You have to select a relatively small number of values to actually test • Which values should you choose? • Equivalence partitioning helps answer this question
  • 8. Equivalence Partitioning • Partition the input's domain into "equivalence classes" • Each equivalence class contains a set of "equivalent" values • Two values are considered to be equivalent if we expect the program to process them both in the same way • If you expect the program to process two values in the same way, only test one of them, thus reducing the number of test cases you have to run
  • 10. ValidInvalid Equivalence Partitioning • Partition valid and invalid values into equivalence classes
  • 11. ValidInvalid Equivalence Partitioning • Create a test case for at least one value from each equivalence class
  • 12. Equivalence Partitioning • Equivalence classes can overlap • If an oracle is available, the test values in each equivalence class can be randomly generated. This is more useful than always testing the same static values. – Oracle: something that can tell you whether a test passed or failed • Test multiple values in each equivalence class. Often you’re not sure if you have defined the equivalence classes correctly or completely, and testing multiple values in each class is more thorough than relying on a single value.
  • 13. Equivalence Partitioning - examples Input Valid Equivalence Classes Invalid Equivalence Classes A integer N such that: -99 <= N <= 99 ? ? Phone Number Area code: [200, 999] Prefix: (200, 999] Suffix: Any 4 digits ? ?
  • 14. Equivalence Partitioning - examples Input Valid Equivalence Classes Invalid Equivalence Classes A integer N such that: -99 <= N <= 99 [-99, -10] [-9, -1] 0 [1, 9] [10, 99] ? Phone Number Area code: [200, 999] Prefix: (200, 999] Suffix: Any 4 digits ? ?
  • 15. Equivalence Partitioning - examples Input Valid Equivalence Classes Invalid Equivalence Classes A integer N such that: -99 <= N <= 99 [-99, -10] [-9, -1] 0 [1, 9] [10, 99] < -99 > 99 Malformed numbers {12-, 1-2-3, …} Non-numeric strings {junk, 1E2, $13} Empty value Phone Number Area code: [200, 999] Prefix: (200, 999] Suffix: Any 4 digits ? ?
  • 16. Equivalence Partitioning - examples Input Valid Equivalence Classes Invalid Equivalence Classes A integer N such that: -99 <= N <= 99 [-99, -10] [-9, -1] 0 [1, 9] [10, 99] < -99 > 99 Malformed numbers {12-, 1-2-3, …} Non-numeric strings {junk, 1E2, $13} Empty value Phone Number Area code: [200, 999] Prefix: (200, 999] Suffix: Any 4 digits 555-5555 (555)555-5555 555-555-5555 200 <= Area code <= 999 200 < Prefix <= 999 ?
  • 17. Equivalence Partitioning - examples Input Valid Equivalence Classes Invalid Equivalence Classes A integer N such that: -99 <= N <= 99 [-99, -10] [-9, -1] 0 [1, 9] [10, 99] < -99 > 99 Malformed numbers {12-, 1-2-3, …} Non-numeric strings {junk, 1E2, $13} Empty value Phone Number Area code: [200, 999] Prefix: (200, 999] Suffix: Any 4 digits 555-5555 (555)555-5555 555-555-5555 200 <= Area code <= 999 200 < Prefix <= 999 Invalid format 5555555, (555)(555)5555, etc. Area code < 200 or > 999 Area code with non-numeric characters Similar for Prefix and Suffix
  • 18. Boundary Value Analysis • When choosing values from an equivalence class to test, use the values that are most likely to cause the program to fail • Errors tend to occur at the boundaries of equivalence classes rather than at the "center" – If (200 < areaCode && areaCode < 999) { // valid area code } – Wrong! – If (200 <= areaCode && areaCode <= 999) { // valid area code } – Testing area codes 200 and 999 would catch this error, but a center value like 770 would not • In addition to testing center values, we should also test boundary values – Right on a boundary – Very close to a boundary on either side
  • 19. ValidInvalid Boundary Value Analysis • Create test cases to test boundaries of equivalence classes
  • 20. Boundary Value Analysis - examples Input Boundary Cases A number N such that: -99 <= N <= 99 ? Phone Number Area code: [200, 999] Prefix: (200, 999] Suffix: Any 4 digits ?
  • 21. Boundary Value Analysis - examples Input Boundary Cases A number N such that: -99 <= N <= 99 -100, -99, -98 -10, -9 -1, 0, 1 9, 10 98, 99, 100 Phone Number Area code: [200, 999] Prefix: (200, 999] Suffix: Any 4 digits ?
  • 22. Boundary Value Analysis - examples Input Boundary Cases A number N such that: -99 <= N <= 99 -100, -99, -98 -10, -9 -1, 0, 1 9, 10 98, 99, 100 Phone Number Area code: [200, 999] Prefix: (200, 999] Suffix: Any 4 digits Area code: 199, 200, 201 Area code: 998, 999, 1000 Prefix: 200, 199, 198 Prefix: 998, 999, 1000 Suffix: 3 digits, 5 digits
  • 23. Boundary Value Analysis - examples • Numeric values are often entered as strings which are then converted to numbers internally [int x = atoi(str);] • This conversion requires the program to distinguish between digits and non-digits • A boundary case to consider: Will the program accept / and : as digits? / 0 1 2 3 4 5 6 7 8 9 : 47 48 49 50 51 52 53 54 55 56 57 58 Char ASCII
  • 24. Testing combinations of inputs • Equivalence Partitioning and Boundary Value Analysis are performed on each individual input, resulting in a set of test values for each input – TV1 = set of test values for Input 1 – TV2 = set of test values for Input 2 – Etc. • Beyond testing individual inputs, we must also consider input combinations
  • 25. Testing combinations of inputs • Suppose there are 3 inputs • An input combination is a 3-tuple (tv1, tv2, tv3) – where tv1 ∈ TV1, tv2 ∈ TV2, tv3 ∈ TV3 • Test as many different combinations as possible • Avoid testing redundant combinations (ones that follow the same path thru the code) • Vary multiple inputs at once to better cover the input domain X X TV1 TV2 TV3
  • 26. Testing combinations of inputs • Rather than analyzing each input individually, it often makes sense to do EP and BVA on multiple inputs together • If two or more inputs interact heavily with each other, effective testing often requires their values to be selected together • In this case, each “test value” is actually a tuple of values • Example: Substring Search (solution) (a1,b1,c1) (a2,b2,c2)
  • 27. Mainstream usage testing • Don't get so wrapped up in testing boundary cases that you neglect to test "normal" input values – Values that users would typically enter during mainstream usage
  • 28. More black box testing examples • Black Box Example #2 • Black Box Example #3
  • 29. Error Guessing • Based on intuition, guess what kinds of inputs might cause the program to fail • Create some test cases based on your guesses • Intuition will often lead you toward boundary cases, but not always • Some special cases aren't boundary values, but are mishandled by many programs – Try exiting the program while it's still starting up – Try loading a corrupted file – Try strange but legal URLs: hTtP://Www.bYu.EDU/
  • 30. State Transition testing • Every interactive program has user observable states – What screen the user is on – What information is displayed to the user – What actions the user is allowed to perform • User observable states are often modeled using a screen flow diagram that shows how users can move from screen to screen
  • 31. State Transition testing • Ideally, you will test all of the different paths that a user may follow to reach each screen, and ensure that the program is always in the correct state – Example: Test all of the different paths for reaching the “Order Confirmation" screen on an e-commerce web site. Can you trick the software into letting you submit an order without entering payment information? • It's not only where you are, but also how you got there
  • 32. Comparison Testing • Also called Back-to-Back testing • If you have multiple implementations of the same functionality, you can run test inputs through both implementations, and compare the results for equality • Why would you have access to multiple implementations? – Safety-critical systems sometimes use multiple, independent implementations of critical modules to ensure the accuracy of results – You might use a competitor's product, or an earlier version of your own, as the second implementation – You might write a software simulation of a new chip that serves as the specification to the hardware designers. After building the chip, you could compare the results computed by the chip hardware with the results computed by the software simulator • Inputs may be randomly generated or designed manually
  • 33. Testing for race conditions and other timing dependencies • Many systems perform multiple concurrent activities – Operating systems manage concurrent programs, interrupts, etc. – Servers service many clients simultaneously – Applications let users perform multiple concurrent actions • Test a variety of different concurrency scenarios, focusing on activities that are likely to share resources (and therefore conflict) • "Race conditions" are bugs that occur only when concurrent activities interleave in particular ways, thus making them difficult to reproduce • Test on hardware of various speeds to ensure that your system works well on both slower and faster machines
  • 34. Performance Testing • Measure the system's performance – Running times of various tasks – Memory usage, including memory leaks – Network usage (Does it consume too much bandwidth? Does it open too many connections?) – Disk usage (Is the disk footprint reasonable? Does it clean up temporary files properly?) – Process/thread priorities (Does it play well with other applications, or does it hog the whole machine?)
  • 35. Limit Testing • Test the system at the limits of normal use • Test every limit on the program's behavior defined in the requirements – Maximum number of concurrent users or connections – Maximum number of open files – Maximum request size – Maximum file size – Etc. • What happens when you go slightly beyond the specified limits? – Does the system's performance degrade dramatically, or gracefully?
  • 36. Stress Testing • Test the system under extreme conditions (i.e., beyond the limits of normal use) • Create test cases that demand resources in abnormal quantity, frequency, or volume – Low memory conditions – Disk faults (read/write failures, full disk, file corruption, etc.) – Network faults – Unusually high number of requests – Unusually large requests or files – Unusually high data rates (what happens if the network suddenly becomes ten times faster?) • Even if the system doesn't need to work in such extreme conditions, stress testing is an excellent way to find bugs
  • 37. Random Testing • Randomly generate test inputs – Could be based on some statistical model • How do you tell if the test case succeeded? – Where do the expected results come from? – Some type of “oracle” is needed • Expected results could be calculated manually – Possible, but lots of work • Automated oracles can often be created to measure characteristics of the system – Performance (memory usage, bandwidth, running times, etc.) – Did the system crash? – Maximum and average user response time under simulated user load
  • 38. Security Testing • Any system that manages sensitive information or performs sensitive functions may become a target for intrusion (i.e., hackers) • How feasible is it to break into the system? • Learn the techniques used by hackers • Try whatever attacks you can think of • Hire a security expert to break into the system • If somebody broke in, what damage could they do? • If an authorized user became disgruntled, what damage could they do?
  • 39. Usability Testing • Is the user interface intuitive, easy to use, organized, logical? • Does it frustrate users? • Are common tasks simple to do? • Does it conform to platform-specific conventions? • Get real users to sit down and use the software to perform some tasks • Watch them performing the tasks, noting things that seem to give them trouble • Get their feedback on the user interface and any suggested improvements • Report bugs for any problems encountered
  • 40. Recovery Testing • Try turning the power off or otherwise crashing the program at arbitrary points during its execution – Does the program come back up correctly when you restart it? – Was the program’s persistent data corrupted (files, databases, etc.)? – Was the extent of user data loss within acceptable limits? • Can the program recover if its configuration files have been corrupted or deleted? • What about hardware failures? Does the system need to keep working when its hardware fails? If so, verify that it does so.
  • 41. Configuration Testing • Test on all required hardware configurations – CPU, memory, disk, graphics card, network card, etc. • Test on all required operating systems and versions thereof – Virtualization technologies such as VMWare and Virtual PC are very helpful for this • Test as many Hardware/OS combinations as you can • Test installation programs and procedures on all relevant configurations
  • 42. Compatibility Testing • Test to make sure the program is compatible with other programs it is supposed to work with • Ex: Can Word 12.0 load files created with Word 11.0? • Ex: "Save As… Word, Word Perfect, PDF, HTML, Plain Text" • Ex: "This program is compatible with Internet Explorer and Firefox" • Test all compatibility requirements
  • 43. Documentation Testing • Test all instructions given in the documentation to ensure their completeness and accuracy • For example, “How To ...” instructions are sometimes not updated to reflect changes in the user interface • Test user documentation on real users to ensure it is clear and complete

Editor's Notes

  1. &amp;lt;number&amp;gt;
  2. &amp;lt;number&amp;gt;
  3. &amp;lt;number&amp;gt;
  4. &amp;lt;number&amp;gt;
  5. &amp;lt;number&amp;gt;
  6. &amp;lt;number&amp;gt;
  7. &amp;lt;number&amp;gt;
  8. &amp;lt;number&amp;gt;
  9. &amp;lt;number&amp;gt;
  10. &amp;lt;number&amp;gt;
  11. &amp;lt;number&amp;gt;
  12. &amp;lt;number&amp;gt;
  13. &amp;lt;number&amp;gt;
  14. &amp;lt;number&amp;gt;
  15. &amp;lt;number&amp;gt;
  16. &amp;lt;number&amp;gt;
  17. &amp;lt;number&amp;gt;
  18. &amp;lt;number&amp;gt;
  19. &amp;lt;number&amp;gt;
  20. &amp;lt;number&amp;gt;
  21. &amp;lt;number&amp;gt;
  22. &amp;lt;number&amp;gt;
  23. &amp;lt;number&amp;gt;
  24. &amp;lt;number&amp;gt;
  25. &amp;lt;number&amp;gt;
  26. &amp;lt;number&amp;gt;
  27. &amp;lt;number&amp;gt;
  28. &amp;lt;number&amp;gt;
  29. &amp;lt;number&amp;gt;
  30. &amp;lt;number&amp;gt;
  31. &amp;lt;number&amp;gt;
  32. EX: Nvidia graphics chips specified with software simulation. Real chip compared back-to-back with simulation to verify implementation. EX: Database drivers EX: Web Crawler in 240 &amp;lt;number&amp;gt;
  33. &amp;lt;number&amp;gt;
  34. &amp;lt;number&amp;gt;
  35. &amp;lt;number&amp;gt;
  36. &amp;lt;number&amp;gt;
  37. &amp;lt;number&amp;gt;
  38. &amp;lt;number&amp;gt;
  39. &amp;lt;number&amp;gt;
  40. &amp;lt;number&amp;gt;
  41. &amp;lt;number&amp;gt;
  42. &amp;lt;number&amp;gt;
  43. &amp;lt;number&amp;gt;