SlideShare a Scribd company logo
Black Box Testing
Amaar Hassan
Black Box Testing
 Block-box testing (or functional testing, or behavior testing) focuses on the
functional requirements of the software.
 In black-box testing, the system is like a black-box whose behavior can
only be determined by studying its inputs and the related outputs
 A set of test cases is derived to exercise all functional requirements for the
program.
 These tests are generally derived from the program specification
 Black-box testing attempts to find the error in the following categories
 Incorrect or missing functions
 Interface errors
 Error in data structures or external database access
 Performance errors
 Initialization and termination error
Black Box Testing
Black Box Testing
 Equivalence classes
 Boundary value analysis
Why testing is hard
 Let’s take a trivial example
 Test the addition operation on a 32-bit machine
c = a + b
 How many tests are needed?
 How many values for a? 232
 How many values for b? 232
 Total possible input combinations? 232 x 232 = 264
Why testing is hard
 Total possible input combinations? 232 x 232 = 264
 Assume:
 1 addition test requires 1 CPU cycle to execute
 3GHz machine
 1GH = 1,000,000,000 Hz = 108
 1GHz means 1 billion cycles per second
 One addition test/~1 cycle = 3x108 test/sec
 Time = 264 / 3x108 = 6 x 1010 sec
= 694,445 days
 Clearly need a smarter technique!!
An Efficient way
 Many tests are redundant
In the adder example, most tests are equivalent.
They do not exercise any new part of the underlying circuit
For example, you might argue that
all additions of +ve numbers without overflow are equivalent
Addition of 0 to a +ve number is the same for all +ve numbers
Similarly for 0 + -ve number … etc.
 This divides the tests into Equivalence Classes
 Only one representative of each class need be tested!
Equivalence Classes
 A set of equivalence classes is a partition of a set such that
Each element of the set is a member of exactly one
equivalence class
 Only one representative of each class needs to be tested!
 All other tests of inputs in the same equivalence class just repeat the
first one!
Dramatic reduction in total number of tests
No loss of ‘coverage’ or satisfaction that tests are complete
Adder Example
Equivalence classes
Clearly, we’ve achieved a dramatic reduction in
number of required tests!
Equivalence classes (Formal Def.)
 The elements of an equivalence class, C, are classified by an
equivalence relation, ~
 If a  C and b  C , then a ~ b
 The equivalence relation is
Reflexive a ~ a
Transitive if a ~ b and b ~ c, then a ~ c
Symmetric if a ~ b then b ~ a
 A Representative of each class is an arbitrary member of the class
 They’re all ‘equivalent’ – so choose any one!
Age Example
 Equivalence classes are derived from rules in the specification
eg admission price: if age < 6, then free
if age < 16, then 50%
else full price
would lead to 3 equivalence classes:
age < 6; age  6  age < 16; age  16;
 Choose representatives 3, 9 and 29 (or many other sets)
Equivalence classes
Equivalence classes
Other special cases
 Nulls
Identity under addition: x + 0 = x
 Unity
Identity under multiplication: x  1 = x
 Range Maxima and Minima
 illegal values
Should raise exceptions or return errors
Read the specification to determine behavior!
Equivalence classes
 Consider this function
int max( int a, int b ){
if( a > b ) return a;
else return b;
}
 There are two paths through this code, so the inputs falls into two
classes
Those for which a > b and
the rest
 This implies that we have only two tests to make:
 (a=5, b=3) and
 (a=4, b=6)
Boundary Value Analysis (BVA)
 If you can safely and confidently walk along the edge of a cliff without
falling off, you can almost certainly walk in the middle of a field.
 If software can operate on the edge of its capabilities, it will almost
certainly operate well under normal conditions.
Boundary Value Analysis (BVA)
 First–1/Last+1
 Start–1/Finish+1
 Less than Empty/More than Full
 Even Slower/Even Faster
 Largest+1/Smallest–1
 Min–1/Max+1
 Just Over/Just Under
 Even Shorter/Longer
 Even Sooner/Later
 Highest+1/Lowest–1
Example of EC
 A Program which edits the credit limits within a given range
($10,000 - $15,000) would have 3 equivalence classes
< 10,000 (invalid)
Between 10,000 and 15,000 (valid)
> 15,000 (invalid)
Example of BVA
 A Program which edits the credit limits within a given range
($10,000 - $15,000) would have 3 equivalence classes
Lower boundary: - / + 1 (9,999 and 10,001)
On the boundary: (10,000 and 15,000)
Upper boundary: - / + 1 (14,999 and 15,001)
Types of testing under B.B.T.
The types of testing performed under Black box
testing
Integration testing (partial)
System testing
Acceptance testing
Regression testing (partial)
Testing after new changes are made
System testing
 System testing is testing conducted on complete, integrated
system to evaluate system compliance with its requirements.
 It comes after Integration testing
 Objectives
To check whether the software system is made according to the
customer needs
To check for both functional and non-functional testing
To execute real life scenarios on the software
Acceptance testing
 Acceptance testing is testing performed to check the acceptability of
the system.
 Acceptance Testing is performed after System Testing and before
making the system available for actual use.
 There are two types of Acceptance testing
1. Internal Acceptance testing (Alpha Testing)
 It is performed by members of the organization that developed the
software but are not directly involved in the project (Development or
Testing).
 Usually, it is the members of Product Management, Sales and/or
Customer Support and it is performed inside the software
organization.
Acceptance testing
2. External Acceptance testing
It is performed by customer and users.
It has two types
Customer Acceptance Testing
This is done by customers who asked the organization to build the
software for them.
User Acceptance Testing (Beta Testing)
 This is done by the final users of the software at their place
The Testing path
In a bigger picture
 During the process of manufacturing a ballpoint pen, the cap, the
body, the tail and clip, the ink cartridge and the ballpoint are
produced separately and unit tested separately.
 When two or more units are ready, they are assembled and
Integration Testing is performed.
 When the complete pen is integrated, System Testing is performed
to see if meets the specification.
 Once System Testing is complete, Acceptance Testing is performed
so as to confirm that the ballpoint pen is ready to be made available
to the end-users.
All in All (WBT and BBT)
Differences
between
WBT and
BBT
Gray Box Testing
 Gray box testing is a combination of white and black box testing
 The tester knows a little about internal working and functional
requirements as well.
 In that way tester is in better position to judge the implementation
as well as check conformance with the requirements.
 Regarded as unbiased testing
Gray Box Testing…Example
 Validation of a website is tested in a grey-box way
 Grey box tester knows that validation is done using a JavaScript at
client-side but does not know implementation details
 Now that we know the underlying mechanism, we can challenge it,
for its strengths and weaknesses.
 He can turn off library and see how system would handle validation
without JavaScript library
 One can perform better testing of mobile if he has a little idea about
its working (OS and Hardware).
Gray Box Testing…Example
 Which scenario presents higher probability for a good testing?
 1. Testing a car without knowing the technologies It uses.
 1. Testing a car, while knowing the technologies (hw sw) it uses
That’s all folks

More Related Content

What's hot

Software testing
Software testingSoftware testing
Software testing
mkn3009
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testing
Oana Feidi
 
Unit testing
Unit testing Unit testing
Unit testing
Mani Kanth
 
Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)
Mani Kanth
 
Testing
TestingTesting
Software testing
Software testing Software testing
Software testing
Kunal Prajapati
 
Software testing
Software testingSoftware testing
Software testing
Madhumita Chatterjee
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
Chankey Pathak
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Ankit Prajapati
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-concepts
medsherb
 
What is Test Plan? Edureka
What is Test Plan? EdurekaWhat is Test Plan? Edureka
What is Test Plan? Edureka
Edureka!
 
Software Testing Introduction
Software Testing IntroductionSoftware Testing Introduction
Software Testing Introduction
ArunKumar5524
 
Software testing
Software testingSoftware testing
Software testing
Bhagyashree pathak
 
Black box testing or behavioral testing
Black box testing or behavioral testingBlack box testing or behavioral testing
Black box testing or behavioral testing
Slideshare
 
Testing concepts [3] - Software Testing Techniques (CIS640)
Testing concepts [3] - Software Testing Techniques (CIS640)Testing concepts [3] - Software Testing Techniques (CIS640)
Testing concepts [3] - Software Testing Techniques (CIS640)
Venkatesh Prasad Ranganath
 
Software Testing
Software TestingSoftware Testing
Software Testing
Dhanasekaran Nagarajan
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
Confiz
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
Mustafa Sherazi
 
Testing, black ,white and gray box testing
Testing, black ,white and gray box testingTesting, black ,white and gray box testing
Testing, black ,white and gray box testing
Aamir Shakir
 
Software testing & Quality Assurance
Software testing & Quality Assurance Software testing & Quality Assurance
Software testing & Quality Assurance
Webtech Learning
 

What's hot (20)

Software testing
Software testingSoftware testing
Software testing
 
Whitebox testing
Whitebox testingWhitebox testing
Whitebox testing
 
Unit testing
Unit testing Unit testing
Unit testing
 
Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)Se (techniques for black box testing ppt)
Se (techniques for black box testing ppt)
 
Testing
TestingTesting
Testing
 
Software testing
Software testing Software testing
Software testing
 
Software testing
Software testingSoftware testing
Software testing
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
 
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
Software Testing - Part 1 (Techniques, Types, Levels, Methods, STLC, Bug Life...
 
Basic software-testing-concepts
Basic software-testing-conceptsBasic software-testing-concepts
Basic software-testing-concepts
 
What is Test Plan? Edureka
What is Test Plan? EdurekaWhat is Test Plan? Edureka
What is Test Plan? Edureka
 
Software Testing Introduction
Software Testing IntroductionSoftware Testing Introduction
Software Testing Introduction
 
Software testing
Software testingSoftware testing
Software testing
 
Black box testing or behavioral testing
Black box testing or behavioral testingBlack box testing or behavioral testing
Black box testing or behavioral testing
 
Testing concepts [3] - Software Testing Techniques (CIS640)
Testing concepts [3] - Software Testing Techniques (CIS640)Testing concepts [3] - Software Testing Techniques (CIS640)
Testing concepts [3] - Software Testing Techniques (CIS640)
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Software testing methods, levels and types
Software testing methods, levels and typesSoftware testing methods, levels and types
Software testing methods, levels and types
 
Black Box Testing
Black Box TestingBlack Box Testing
Black Box Testing
 
Testing, black ,white and gray box testing
Testing, black ,white and gray box testingTesting, black ,white and gray box testing
Testing, black ,white and gray box testing
 
Software testing & Quality Assurance
Software testing & Quality Assurance Software testing & Quality Assurance
Software testing & Quality Assurance
 

Similar to 5 black box and grey box testing

CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4
SIMONTHOMAS S
 
Unit testing
Unit testingUnit testing
Unit testing
medsherb
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing Fundamentals
Kiran Kumar
 
Software testing
Software testingSoftware testing
Software testing
Bala Ganesh
 
Test Levels & Techniques
Test Levels & TechniquesTest Levels & Techniques
Test Levels & Techniques
Dhanasekaran Nagarajan
 
CTFL Module 04
CTFL Module 04CTFL Module 04
CTFL Module 04
Davis Thomas
 
black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdf
SupunLakshan4
 
Dynamic analysis in Software Testing
Dynamic analysis in Software TestingDynamic analysis in Software Testing
Dynamic analysis in Software Testing
Sagar Pednekar
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
Nishant Worah
 
Testing
TestingTesting
Testing
Mohammed
 
SE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptxSE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptx
200723KarthikeyanD
 
software testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblbsoftware testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblb
jeyasrig
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
bhushan Nehete
 
Testing
TestingTesting
Testing
nazeer pasha
 
Testing techniques
Testing techniquesTesting techniques
Testing techniques
RaginiRohatgi
 
Black box testing
Black box testingBlack box testing
Black box testing
Abdul Basit
 
5.Black Box Testing and Levels of Testing.ppt
5.Black Box Testing and Levels of Testing.ppt5.Black Box Testing and Levels of Testing.ppt
5.Black Box Testing and Levels of Testing.ppt
SyedAhmad732853
 
12 functional-system-testing
12 functional-system-testing12 functional-system-testing
12 functional-system-testing
nickynicks76
 
Ch 6 randomization
Ch 6 randomizationCh 6 randomization
Ch 6 randomization
Team-VLSI-ITMU
 
Understanding Black Box Testing – Types, Techniques, and Examples.pdf
Understanding Black Box Testing – Types, Techniques, and Examples.pdfUnderstanding Black Box Testing – Types, Techniques, and Examples.pdf
Understanding Black Box Testing – Types, Techniques, and Examples.pdf
pCloudy
 

Similar to 5 black box and grey box testing (20)

CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4CS8494 SOFTWARE ENGINEERING Unit-4
CS8494 SOFTWARE ENGINEERING Unit-4
 
Unit testing
Unit testingUnit testing
Unit testing
 
Testing Fundamentals
Testing FundamentalsTesting Fundamentals
Testing Fundamentals
 
Software testing
Software testingSoftware testing
Software testing
 
Test Levels & Techniques
Test Levels & TechniquesTest Levels & Techniques
Test Levels & Techniques
 
CTFL Module 04
CTFL Module 04CTFL Module 04
CTFL Module 04
 
black-box-1.pdf
black-box-1.pdfblack-box-1.pdf
black-box-1.pdf
 
Dynamic analysis in Software Testing
Dynamic analysis in Software TestingDynamic analysis in Software Testing
Dynamic analysis in Software Testing
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
 
Testing
TestingTesting
Testing
 
SE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptxSE%200-Testing%20(2).pptx
SE%200-Testing%20(2).pptx
 
software testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblbsoftware testing types jxnvlbnLCBNFVjnl/fknblb
software testing types jxnvlbnLCBNFVjnl/fknblb
 
Lesson 2....PPT 1
Lesson 2....PPT 1Lesson 2....PPT 1
Lesson 2....PPT 1
 
Testing
TestingTesting
Testing
 
Testing techniques
Testing techniquesTesting techniques
Testing techniques
 
Black box testing
Black box testingBlack box testing
Black box testing
 
5.Black Box Testing and Levels of Testing.ppt
5.Black Box Testing and Levels of Testing.ppt5.Black Box Testing and Levels of Testing.ppt
5.Black Box Testing and Levels of Testing.ppt
 
12 functional-system-testing
12 functional-system-testing12 functional-system-testing
12 functional-system-testing
 
Ch 6 randomization
Ch 6 randomizationCh 6 randomization
Ch 6 randomization
 
Understanding Black Box Testing – Types, Techniques, and Examples.pdf
Understanding Black Box Testing – Types, Techniques, and Examples.pdfUnderstanding Black Box Testing – Types, Techniques, and Examples.pdf
Understanding Black Box Testing – Types, Techniques, and Examples.pdf
 

Recently uploaded

Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 

Recently uploaded (20)

Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 

5 black box and grey box testing

  • 2. Black Box Testing  Block-box testing (or functional testing, or behavior testing) focuses on the functional requirements of the software.  In black-box testing, the system is like a black-box whose behavior can only be determined by studying its inputs and the related outputs  A set of test cases is derived to exercise all functional requirements for the program.  These tests are generally derived from the program specification  Black-box testing attempts to find the error in the following categories  Incorrect or missing functions  Interface errors  Error in data structures or external database access  Performance errors  Initialization and termination error
  • 4. Black Box Testing  Equivalence classes  Boundary value analysis
  • 5. Why testing is hard  Let’s take a trivial example  Test the addition operation on a 32-bit machine c = a + b  How many tests are needed?  How many values for a? 232  How many values for b? 232  Total possible input combinations? 232 x 232 = 264
  • 6. Why testing is hard  Total possible input combinations? 232 x 232 = 264  Assume:  1 addition test requires 1 CPU cycle to execute  3GHz machine  1GH = 1,000,000,000 Hz = 108  1GHz means 1 billion cycles per second  One addition test/~1 cycle = 3x108 test/sec  Time = 264 / 3x108 = 6 x 1010 sec = 694,445 days  Clearly need a smarter technique!!
  • 7. An Efficient way  Many tests are redundant In the adder example, most tests are equivalent. They do not exercise any new part of the underlying circuit For example, you might argue that all additions of +ve numbers without overflow are equivalent Addition of 0 to a +ve number is the same for all +ve numbers Similarly for 0 + -ve number … etc.  This divides the tests into Equivalence Classes  Only one representative of each class need be tested!
  • 8. Equivalence Classes  A set of equivalence classes is a partition of a set such that Each element of the set is a member of exactly one equivalence class  Only one representative of each class needs to be tested!  All other tests of inputs in the same equivalence class just repeat the first one! Dramatic reduction in total number of tests No loss of ‘coverage’ or satisfaction that tests are complete
  • 9. Adder Example Equivalence classes Clearly, we’ve achieved a dramatic reduction in number of required tests!
  • 10. Equivalence classes (Formal Def.)  The elements of an equivalence class, C, are classified by an equivalence relation, ~  If a  C and b  C , then a ~ b  The equivalence relation is Reflexive a ~ a Transitive if a ~ b and b ~ c, then a ~ c Symmetric if a ~ b then b ~ a  A Representative of each class is an arbitrary member of the class  They’re all ‘equivalent’ – so choose any one!
  • 11. Age Example  Equivalence classes are derived from rules in the specification eg admission price: if age < 6, then free if age < 16, then 50% else full price would lead to 3 equivalence classes: age < 6; age  6  age < 16; age  16;  Choose representatives 3, 9 and 29 (or many other sets) Equivalence classes
  • 12. Equivalence classes Other special cases  Nulls Identity under addition: x + 0 = x  Unity Identity under multiplication: x  1 = x  Range Maxima and Minima  illegal values Should raise exceptions or return errors Read the specification to determine behavior!
  • 13. Equivalence classes  Consider this function int max( int a, int b ){ if( a > b ) return a; else return b; }  There are two paths through this code, so the inputs falls into two classes Those for which a > b and the rest  This implies that we have only two tests to make:  (a=5, b=3) and  (a=4, b=6)
  • 14. Boundary Value Analysis (BVA)  If you can safely and confidently walk along the edge of a cliff without falling off, you can almost certainly walk in the middle of a field.  If software can operate on the edge of its capabilities, it will almost certainly operate well under normal conditions.
  • 15. Boundary Value Analysis (BVA)  First–1/Last+1  Start–1/Finish+1  Less than Empty/More than Full  Even Slower/Even Faster  Largest+1/Smallest–1  Min–1/Max+1  Just Over/Just Under  Even Shorter/Longer  Even Sooner/Later  Highest+1/Lowest–1
  • 16. Example of EC  A Program which edits the credit limits within a given range ($10,000 - $15,000) would have 3 equivalence classes < 10,000 (invalid) Between 10,000 and 15,000 (valid) > 15,000 (invalid)
  • 17. Example of BVA  A Program which edits the credit limits within a given range ($10,000 - $15,000) would have 3 equivalence classes Lower boundary: - / + 1 (9,999 and 10,001) On the boundary: (10,000 and 15,000) Upper boundary: - / + 1 (14,999 and 15,001)
  • 18. Types of testing under B.B.T. The types of testing performed under Black box testing Integration testing (partial) System testing Acceptance testing Regression testing (partial) Testing after new changes are made
  • 19. System testing  System testing is testing conducted on complete, integrated system to evaluate system compliance with its requirements.  It comes after Integration testing  Objectives To check whether the software system is made according to the customer needs To check for both functional and non-functional testing To execute real life scenarios on the software
  • 20. Acceptance testing  Acceptance testing is testing performed to check the acceptability of the system.  Acceptance Testing is performed after System Testing and before making the system available for actual use.  There are two types of Acceptance testing 1. Internal Acceptance testing (Alpha Testing)  It is performed by members of the organization that developed the software but are not directly involved in the project (Development or Testing).  Usually, it is the members of Product Management, Sales and/or Customer Support and it is performed inside the software organization.
  • 21. Acceptance testing 2. External Acceptance testing It is performed by customer and users. It has two types Customer Acceptance Testing This is done by customers who asked the organization to build the software for them. User Acceptance Testing (Beta Testing)  This is done by the final users of the software at their place
  • 23. In a bigger picture  During the process of manufacturing a ballpoint pen, the cap, the body, the tail and clip, the ink cartridge and the ballpoint are produced separately and unit tested separately.  When two or more units are ready, they are assembled and Integration Testing is performed.  When the complete pen is integrated, System Testing is performed to see if meets the specification.  Once System Testing is complete, Acceptance Testing is performed so as to confirm that the ballpoint pen is ready to be made available to the end-users.
  • 24. All in All (WBT and BBT)
  • 26. Gray Box Testing  Gray box testing is a combination of white and black box testing  The tester knows a little about internal working and functional requirements as well.  In that way tester is in better position to judge the implementation as well as check conformance with the requirements.  Regarded as unbiased testing
  • 27. Gray Box Testing…Example  Validation of a website is tested in a grey-box way  Grey box tester knows that validation is done using a JavaScript at client-side but does not know implementation details  Now that we know the underlying mechanism, we can challenge it, for its strengths and weaknesses.  He can turn off library and see how system would handle validation without JavaScript library  One can perform better testing of mobile if he has a little idea about its working (OS and Hardware).
  • 28. Gray Box Testing…Example  Which scenario presents higher probability for a good testing?  1. Testing a car without knowing the technologies It uses.  1. Testing a car, while knowing the technologies (hw sw) it uses

Editor's Notes

  1. Gray box testing is regarded as unbiased testing because the tester has limited knowledge of implementation, so he won’t be biased towards implementation like a developer. Naturally a developer will test the software in a way that it wont go against his implementation.
  2. If we know the technologies of a car including its hardware and software, we can test it by making challenging terrains, low light conditions, bright light conditions, humid areas, rough and patchy roads, long drives, speed ranges etc. Testing a scanner without knowing how it operates vs. testing a scanner or photocopy machine, while knowing how it works.