0% found this document useful (0 votes)
20 views26 pages

Resource 20240331112923 Black Box Testing

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)
20 views26 pages

Resource 20240331112923 Black Box Testing

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
You are on page 1/ 26

Black-box Testing

Black-box Testing
• Black-box testing is a type of software
testing in which the tester is not concerned
with the internal knowledge or
implementation details of the software, but
rather focuses on validating the
functionality based on the provided
specifications or requirements.
Types
• Functional Testing
• Regression Testing
• Nonfunctional Testing (NFT)
Equivalence Partitioning
• A black-box testing method that divides the input domain
of a program into classes of data from which test cases are
derived
• An ideal test case single-handedly uncovers a complete
class of errors, thereby reducing the total number of test
cases that must be developed
• Test case design is based on an evaluation of equivalence
classes for an input condition
• An equivalence class represents a set of valid or invalid
states for input conditions
• From each equivalence class, test cases are selected so that
the largest number of attributes of an equivalence class are
exercise at once
7
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}

8
Example of Equivalence
Partitioning Technique
• For example, an OTP number which
contains only six digits, less or more than
six digits will not be accepted, and the
application will redirect the user to the error
page.
Example of Equivalence
Partitioning Technique
Example of Equivalence
Partitioning Technique
• A function of the software application
accepts a 10 digit mobile number.
Example of Equivalence
Partitioning Technique
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

13
Guidelines for
Boundary Value Analysis
• . If an input condition specifies a range bounded by values a and b, test cases
should be designed with values a and b as well as values just above and just
below a and b
• . If an input condition specifies a number of values, test case should be
developed that exercise the minimum and maximum numbers. Values just
above and just below the minimum and maximum are also tested
• Apply guidelines 1 and 2 to output conditions; produce output that reflects the
minimum and the maximum values expected; also test the values just below
and just above
• If internal program data structures have prescribed boundaries (e.g., an array),
design a test case to exercise the data structure at its minimum and maximum
boundaries

14
Boundary Value Analysis
BVA is based on the single fault assumption, also known as critical fault
assumption which states that failures are rarely the product of two or more
simultaneous faults. That is faults are very rarely the result of the simultaneous
occurrence of two or more faults. Hence while designing the test cases for BVA
we keep all variable to the nominal value and allowing the one variable to take the
extreme value.
Two fault assumption means that in test cases two of input variables assume their
boundary values while all remaining variables – their nominal values.
Generally, we can speak about N-fault assumption or multiple fault assumption
when the method requires a boundary value for all of program’s input variables
for the test case.
If the test suite is generated according to single fault assumption and some test
case fails, there is a good reason to suppose that the input parameter with
boundary value is incorrectly processed. But such test suite will be bigger or more
complex than a test suite generated according to N-fault assumption. On the other
hand, if the test case generated according to N-fault assumption fails, it is a more
complex task to say which boundary or boundaries were processed incorrectly 15
Guidelines for
Boundary Value Analysis
Test Case Design for BVA:
While designing the test cases for BVA first we determine the number of input
variables in the problem. For each input variable, we then determine the range of
values it can take. Then we determine the extreme values and nominal value for
each input variable.
Consider an input variable t taking values in the range [l, r].Extreme values for t
are –
t=l
t = l+1
t = r-1
t=r

16
Boundary Value Analysis
The nominal value for the variable can be any value in the range (l, r).
In most of the BVA implementations, it is taken as the middle value of the range
(r+l)/2.

Under the single fault assumption, the total number of test cases in BVA for a
problem with n inputs is 4n+1.
The 4n cases correspond to the test cases with the four extreme values of each
variable keeping the other n-1 variable at nominal value. The one additional case
is where all variables are held at a nominal value.

17
Boundary Value Analysis
Triangle Problem accepts three integers – a, b, c as three sides of the triangle .We
also define a range for the sides of the triangle as [l, r] where l>0. It returns the
type of triangle (Scalene, Isosceles, Equilateral, Not a Triangle) formed by a, b, c.

For a, b, c to form a triangle the following conditions should be satisfied –

a < b+c
b < a+c
c < a+b
If any of these conditions is violated output is Not a Triangle.

For Equilateral Triangle all the sides are equal.


For Isosceles Triangle exactly one pair of sides is equal.
18
For Scalene Triangle all the sides are different.
Boundary Value Analysis
The table shows the Test Cases Design for the Triangle Problem.The range value
[l, r] is taken as [1, 100] and nominal value is taken as 50.
The total test cases is,

4n+1 = 4*3+1 = 13

19
Boundary Value Analysis
TEST CASE A B C EXPECTED OUTPUT
ID

T1 1 50 50 Isosceles
T2 2 50 50 Isosceles
T3 99 50 50 Isosceles
T4 100 50 50 Not a Traingle
T5 50 50 50 Equilateral
T6 50 1 50 Isosceles
T7 50 2 50 Isosceles
T8 50 99 50 Isosceles
T9 50 100 50 Not a Triangle
T10 50 50 1 Isosceles
T11 50 50 2 Isosceles
T12 50 50 99 Isosceles
T13 50 50 100 Not a Triangle

20
Robustness Testing
Robustness testing can be seen as and extension of Boundary Value Analysis.
In addition to the aforementioned 5 testing values (min, min+, nom, max-, max)
we use two more values for each variable (min-, max+), which are designed to fall
just outside of the input range.
If we adapt our function f to apply to Robustness testing we find the following
equation:
f = 6n + 1
Robustness testing ensues a sway in interest, where the previous interest lied in
the input to the program, the main focus of attention associated with Robustness
testing comes in the expected outputs when and input variable has exceeded the
given input domain

21
Boundary Value Analysis
Example
Assume we have to test a text field (Name) which accepts the length between 6-12
characters

22
Example
• One of the fields on a form contains a
text box that accepts numeric values in
the range of 18 to 25. Identify the invalid
Equivalence class.
• a) 17
b) 19
c) 24
d) 21
Example
• One of the fields on a form contains a
text box that accepts alphanumeric
values. Identify the Valid Equivalence
class.
• a) BOOK
b) Book
c) Boo01k
d) Book
Example
• The Switch is switched off once the temperature falls
below 18 and then it is turned on when the temperature
is more than 21. When the temperature is more than
21. Identify the Equivalence values which belong to the
same class.
a) 12,16,22
b) 24,27,17
c) 22,23,24
d) 14,15,19
Example
• To pass an Exam, a candidate has to score more than 50 marks in
order to clear the exam. The maximum that he can score is 100
marks. Identify the Valid Equivalence values e xcluding min
and max score if the student passes the exam.
• a. 50, 58, 75
• b. 49, 50, 51
• c. 52, 60, 99
• d. 0, 15, 50
Example
• In a system designed to work out the taxes to be paid:
An employee has £4000 of salary tax-free.
The next £1500 is taxed at 10%.
The next £28000 after that is taxed at 22%.
Any further amount is taxed at 40%.
To the nearest whole pound, which of these groups of
numbers fall into three DIFFERENT equivalence classes?
a) £4000; £5000; £5500
b) £32001; £34000; £36500
c) £28000; £28001; £32001
d) £4000; £4200; £5600

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy