0% found this document useful (0 votes)
59 views33 pages

Black Box Testing Techniques Explained

Black-box testing focuses on functional requirements without knowledge of internal implementation. It aims to find errors such as incorrect or missing functions, interface errors, and data or behavior errors. Boundary value analysis and equivalence partitioning are black-box techniques. Boundary value analysis selects test cases at the boundaries of input domains, while equivalence partitioning divides inputs into classes to reduce test cases while ensuring coverage. Examples demonstrate defining equivalence classes and generating test cases for different problems.

Uploaded by

Mark Sietta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views33 pages

Black Box Testing Techniques Explained

Black-box testing focuses on functional requirements without knowledge of internal implementation. It aims to find errors such as incorrect or missing functions, interface errors, and data or behavior errors. Boundary value analysis and equivalence partitioning are black-box techniques. Boundary value analysis selects test cases at the boundaries of input domains, while equivalence partitioning divides inputs into classes to reduce test cases while ensuring coverage. Examples demonstrate defining equivalence classes and generating test cases for different problems.

Uploaded by

Mark Sietta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd

Black-box Testing

Black Box Testing

 Does not replace white box testing


 Focuses on functional requirements of the software
 Tries to find following types of errors:
incorrect or missing functions
interface errors
errors in data structures or database access
behavior or performance errors
Contents

1- Boundary Value Analysis


2- Equivalence Partitioning
Boundary Value Analysis
 A greater number of errors occur at the boundaries of the input domain
rather than in the "center"
 Boundary value analysis is a test case design method that complements
equivalence partitioning
 It selects test cases at the edges of a class
 It derives test cases from both the input domain and output domain

4
Boundary Value Analysis

 More errors occur at boundary of the input domain


 BVA leads to selection of test cases that exercise the
boundaries
 Guidelines:
 Input in range a..b: select a, b, just above and just below a
and b
 Inputs with number of values: select min and max, just
above and below min, max
 boundaries on data structures (array with 100 entries): test
at boundary
Boundary value analysis
 Test cases for input box accepting numbers between 1 and 1000
using Boundary value analysis:
1) Test cases with test data exactly as the input boundaries of
input domain i.e. values 1 and 1000 in our case.
 2) Test data with values just below the extreme edges of input
domains i.e. values 0 and 999.
 3) Test data with values just above the extreme edges of input
domain i.e. values 2 and 1001.
Example
 range between 10-20
 9,10,11 (min-1,min,min+ 1) for the lower limit and

 19,20,21(max- 1,max,max+ 1) for the upper limit.


 The boundary value analysis can have 6 text cases.

But we use equal class partitioning also for minimizing the test cases.
In this example, as per BVA, there are 6 test case data,
9,10,11 and 19,20,21.
But the test will be 9,10 and 20,21 only.
Because these 4 test case is sufficient to test the range, because we get
both positive and negative test case from these 4 values.
Equivalence Partitioning

Black box method that divides the input domain of a


program into classes of data from which test cases can
be derived
This method is typically used to reduce the total number
of test cases to a finite set of testable test cases, still
covering maximum requirements.
Guidelines for Defining Equivalence
Classes
 If an input condition specifies a range, one valid and two invalid equivalence
classes are defined
 Input range: 1 – 10 Eq classes: {1..10}, {x < 1}, {x > 10}
 If an input condition requires a specific value, one valid and two invalid
equivalence classes are defined
 Input value: 250 Eq classes: {250}, {x < 250}, {x > 250}
 If an input condition specifies a member of a set, one valid and one invalid
equivalence class are defined
 Input set: {-2.5, 7.3, 8.4} Eq classes: {-2.5, 7.3, 8.4}, {any other x}
 If an input condition is a Boolean value, one valid and one invalid class are define
 Input: {true condition} Eq classes: {true condition}, {false condition}

9
Equivalence Class Testing
• Use the mathematical concept of partitioning into
equivalence classes to generate test cases for Functional
(Black-box) testing

• The key goals for equivalence class testing are similar to


partitioning:
• completeness of test coverage
• lessen duplication of test coverage
Partitioning
Recall a partitioning of a set, A, is to divide the set A
into ( a1, a2, - - - -, an ) subsets such that:
 a1 U a2 U - - - - U an = A (completeness)
 for any i and j, ai ∩ aj = Ø (no duplication)

Size ≤ 10”
Size > 10”

Partitioning of a Set A of rocks Partitioning of a Set A of rocks


with no relational meaning with relational meaning
( with respect to “size”)
Equivalence Class Test Cases

 Consider a numerical input variable, i, whose values may range from -200
through +200. Then a possible partitioning of testing input variable by 4
people may be:
 -200 to -100
 -101 to 0
 1 to 100
 101 to 200

 Define “same sign” as the equivalence relation, R, defined over the input
variable’s value set, i = {-200 - -,0, - -, +200}. Then one partitioning will be:
 -200 to -1 (negative sign)
 0 (no sign)
 1 to 200 (positive sign)

A sample equivalence test case “set” from the above “same sign” relation would be { -5;
0; 8 }
Weak & Normal Equivalence Class
Testing
Weak Normal Equivalence Class Testing

One variable from each equivalence class


Values identified in systematic way
Example of : Weak Normal Equivalence testing
Assume the equivalence partitioning of input X is: 1 to 10; 11 to 20, 21 to 30
and the equivalence partitioning of input Y is: 1 to 5; 6 to 10; 11;15; and 16 to 20

X We have covered everyone


of the 3 equivalence classes
30 for input X.

20

For ( x, y )
10 we have:
(24, 2)
(15, 8 )
1 ( 4, 13)
Y (23, 17)
1 5 10 15 20
General rule for # of test cases?
We have covered each of the 4
# of partitions of the largest set?
equivalence classes for input Y.
Strong Normal Equivalence Class Testing
Test cases taken from each element of Cartesian
product of the equivalence classes.
Cartesian product guarantees notion of completeness.
Robust Equivalence Class Testing

Robust - consideration of invalid values.


Two problems with robust ECT:
 Difficult or impossible to determine expected values
for invalid variable values
 Not useful for strongly-typed languages (FORTRAN,
COBAL)
Weak Robust Equivalence Class Testing
Valid inputs – weak normal ECT
 Invalid inputs – each TC has one invalid value, single
fault should cause failure.
Strong Robust Equivalence Class Testing

Combination of both robust and strong ECT


Examples
Triangle Problem
Triangle Problem
• Four possible outputs – NotA-Triangle, Scalene, Isosceles
and Equilateral.
• R1 = {<a,b,c> : the triangle with sides a.b and c is
equilateral}
• R2 = {<a,b,c> : the triangle with sides a,b and c is isosceles}
• R3 = {<a,b,c> : the triangle with sides a,b and c is Scalene}
• R4 = {<a,b,c> : sides a,b and c do not form a triangle}
Triangle Problem
Triangle Problem

Weak robust Equivalence Class Test Cases


Triangle Problem

 Here is one “corner” of the cube in 3-space of the


additional strong robust equivalence class test cases.
Examples
Next Date Function Problem
Next Date Function Problem

Previous test cases were poor.


Focus on Equivalence Relation.
 What must be done to an input date?
 We produce a new set of Equivalence Classes.

You might also like