3. Objectives
• Black box testing ignores the structural details of the software.
• Test case designing using black box techniques.
• Boundary value analysis method
• Equivalence class testing method
• State table based testing method
• Decision table based testing method
• Cause-effect graphing method
5. Evolution of Software Testing
• To test the modules independently.
• To test the functional validity of the software
• Interface errors are detected.
• To test the system behavior and check its performance.
• To test the maximum load or stress on the system.
• Customer accepts the system within defined acceptable limits.
Black Box Testing
6. • Test cases are designed by holding one variable at its extreme
value and other variables at their nominal values in the input
domain. The variable at its extreme value can be selected at:
– Minimum value (Min)
– Value just above the minimum value (Min+ )
– Maximum value (Max)
– Value just below the maximum value (Max-)
– Nominal or Average Value
Boundary Value Checking
7. Software Testing
Consider a program for determining the Previous date. Its input is a triple of
day, month and year with the values in the range
1 ≤ month ≤ 12
1 ≤ day ≤ 31
1900 ≤ year ≤ 2025
The possible outputs would be Previous date or invalid input date. Design the
boundary value test cases.
8. Software Testing
Solution
The Previous date program takes a date as input and checks it for validity.
If valid, it returns the previous date as its output.
With single fault assumption theory, 4n+1 test cases can be designed and
which are equal to 13.
10. A value just greater than the Maximum value (Max+)
A value just less than Minimum value (Min-)
• When test cases are designed considering above points in
addition to BVC, it is called Robustness testing.
• Min.Value -1, Min. Value, Min. Value+1, Nominal or Average
Value, Max. Value-1, Max. Value, Max. Value +1
• It can be generalized that for n input variables in a module, 6n+1
test cases are designed with Robustness testing.
Robustness Testing Method
11. Software Testing
Consider a program for determining the Previous date. Its input is a triple of
day, month and year with the values in the range
1 ≤ month ≤ 12
1 ≤ day ≤ 31
1900 ≤ year ≤ 2025
The possible outputs would be Previous date or invalid input date. Design the
Robustness test cases.
14. Software Testing Myths
• When more than one variable are in extreme values, i.e. when more
than one variable are on the boundary. It is called Worst case
testing method.
• It can be generalized that for n input variables in a module, 5n test
cases are designed with worst case testing.
• Preferably Robustness testing ranges could be considered for
assigning values for the variables, so that more test cases could be
designed for invalid inputs
Worst Case Testing Method
15. Software Testing
In case of worst test case total test cases are 5n. Hence, 125 test cases will be
generated in worst test cases. The worst test cases are given below:
Test Case Month Day Year Expected output
1 1 1 1900 31 December, 1899
2 1 1 1901 31 December, 1900
3 1 1 1962 31 December, 1961
4 1 1 2024 31 December, 2023
5 1 1 2025 31 December, 2024
6 1 2 1900 1 January, 1900
7 1 2 1901 1 January, 1901
8 1 2 1962 1 January, 1962
9 1 2 2024 1 January, 2024
10 1 2 2025 1 January, 2025
11 1 15 1900 14 January, 1900
12 1 15 1901 14 January, 1901
13 1 15 1962 14 January, 1962
14 1 15 2024 14 January, 2024
22. Software Testing
Test Case Month Day Year Expected output
119 12 30 2024 29 December, 2024
120 12 30 2025 29 December, 2025
121 12 31 1900 30 December, 1900
122 12 31 1901 30 December, 1901
123 12 31 1962 30 December, 1962
124 12 31 2024 30 December, 2024
125 12 31 2025 30 December, 2025
Note:
1. The author has used BVA ranges for designing the test cases but
you can use Robustness Ranges also designing the test cases.
2. Carefully design the test cases without redundancy
3. Don’t take random values
23. Example
• A program reads an integer number within the range [1,100] and
determines whether the number is a prime number or not. Design all
test cases for this program using BVC, Robust testing and worst-
case testing methods.
• 1) Test cases using BVC
26. Software Testing
Equivalence Class Testing
In this method, input domain of a program is partitioned into a finite number of
equivalence classes such that one can reasonably assume, but not be
absolutely sure, that the test of a representative value of each class is
equivalent to a test of any other value.
Two steps are required to implementing this method:
1. The equivalence classes are identified by taking each input condition and
partitioning it into valid and invalid classes. For example, if an input
condition specifies a range of values from 1 to 999, we identify one valid
equivalence class[1<item<999]; and two invalid equivalence classes
[item<1] and [item>999].
2. Generate the test cases using the equivalence classes identified in the
previous step. This is performed by writing test cases covering all the valid
equivalence classes. Then a test case is written for each invalid equivalence
class so that no test contains more than one invalid class. This is to ensure
that no two invalid classes mask each other.
27. Example
• A program reads three numbers A, B and C with range [1,50] and
prints largest number. Design all test cases for this program using
equivalence class testing technique.
I1 = {<A,B,C> : 1 ≤ A ≤ 50}
I2 = {<A,B,C> : 1 ≤ B ≤ 50}
I3 = {<A,B,C> : 1 ≤ C ≤ 50}
I4 = {<A,B,C> : A < 1}
I5 = {<A,B,C> : A > 50}
I6 = {<A,B,C> : B < 1}
I7 = {<A,B,C> : B > 50}
I8 = {<A,B,C> : C < 1}
I9 = {<A,B,C> : C > 50}
28. • I1 = {<A,B,C> : A > B, A > C}
• I2 = {<A,B,C> : B > A, B > C}
• I3 = {<A,B,C> : C > A, C > B}
• I4 = {<A,B,C> : A = B, A ≠ C}
• I5 = {<A,B,C> : B = C, A ≠ B}
• I6 = {<A,B,C> : A = C, C ≠ B }
• I7 = {<A,B,C> : A = B = C}
Example
30. Decision Table Based Testing
• It is another useful method to represent the
information in a tabular method
• It has the specialty to consider complex combinations
of input conditions and resulting actions.
• Decision tables obtain their power from logical
expressions
• Each operant or variable in a logical expression takes
on the value, TRUE or FALSE
31. • Condition Stub it is a list of input conditions for which the complex
combination is made
• Action Stub it is a list of resulting actions which will be performed if
a combination of input condition is satisfied
• Condition entry it is a specific entry in the table corresponding to
input onditions mentioned in the condition stub. When we enter T or
F for all input conditions for a particular combination, then it is called
a Rule and it defines which combination of conditions produces the
resulting action.
• Action Entry it is the entry in the table for the resulting action to be
performed when one rule is satisfied, ‘X’ denotes the action entry in
the table.
32. Decision Table Based Testing
Example
• A program calculates the total salary of an employee with the conditions
that if the working hours are less than or equal to 48, then give normal
salary. The hours over 48 on normal working days are calculated at the rate
of 1.25 of the salary. However, on holidays or Sundays, the hours are
calculated at the rate of 2.00 times of the salary. Design the test cases
using decision table testing.
33. Decision Table Based Testing
Test case id Working Hour Day Expected
Result
1 48 Monday Normal
Salary(Rule2)
2 45 Tuesday Normal
Salary(Rule 2)
3 50 Tuesday 1.25 of
salary(Rule 3)
4 55 Wednesday 1.25 of salary
(Rule 3)
5 52 Sunday 2.00 of
Salary(Rule 1)
6 60 Holiday 2.00 of
Salary(Rule1)