Professional Documents
Culture Documents
Testing 1. Static Testing 2. Dynamic Testing
Testing 1. Static Testing 2. Dynamic Testing
1. Static Testing
2. Dynamic Testing
1
• Static Testing – before code development
- prevents the error
2
Chapter 4
Dynamic Testing: Black Box
Testing Techniques
3
Objectives
5
Evolution of Software Testing
Black Box Testing
6
• To test the system behavior and check its
performance.
8
Boundary Value Analysis (BVA)
9
Co ordinates of triangle
(10,10)
(255, 10)
(10,100)
( 255, 100)
10
Example of a boundary
• A is a integer between 10 and 255
• Then boundary checking for 10
10(9,10,11)
9 – below the boundary
10 – on the boundary
11 – above the boundary
• Then boundary checking for 255
255(254,255,256)
254 – below the boundary
255 – on the boundary
256 – above the boundary
11
Boundary Value Checking
12
No of Test Cases in Boundary Value checking
• No of variable in a module : n
13
Robustness Testing Method
• Amax+, Bnom
• Amin-, Bnom
• Anom, Bmax+
• Anom, Bmin-
14
No of Test Cases in Robustness Testing method
• No of variable in a module : n
15
Software Testing
Worst Case Myths
Testing Method
• 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.
• Input variables = n ,
• 5n test cases are designed with worst case testing.
16
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.
Solution :
Program reads one integer number
So the no of variable is 1
The no of test cases in BVC : 4 n + 1
put n =1
No of test cases = 5
17
Example
18
No of Test cases in Robust Testing = 6n+1
19
A Program computes a power b where a lies in the range [1,10]
and
b within the range [1,5]. Design test cases for this program using
Boundary Value Checking
20
a b
Min value 1 1
Min + value 2 2
Max value 10 5
Max – value 9 4
Nominal value 5 3
21
Test Case ID a Expected output
b
T101 1 3 1
T102 2 3 8
T103 10 3 1000
T104 9 3 729
T105 5 1 5
T106 5 2 25
T107 5 4 625
T108 5 5 3125
T109 5 3 125
22
Problem
23
Solution
No of input variables = 3
date , month and year
No of Test case = 4n+1
put n =3
No of Test cases = 4*3 +1 = 13
24
Test Month Day Year Expected Output
Case ID
T101 1 15 1962 16-1-1962
T102 2 15 1962 16-2-1962
T103 11 15 1962 16-11-1962
T104 12 15 1962 16-12-1962
T105 6 31 1962 Invalid input
T106 6 15 2024 16-6-2024
T107 6 17 2025 18-6-2025
T108
T109
T110
T111
T112
25
T113
Equivalence Class Testing
26
Goals of Equivalence Testing
• Completeness
- full complete testing of all test cases
• Non redundancy
- reduce the repeated test cases
27
Steps of Equivalence Testing
28
Equivalence Class Testing
29
Example Problem
• Solution :
Partition the domain of input values as valid input and invalid input
30
Classes of input A,B,C
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}
31
Test cases
32
Another Solution
33
34
Problem -2
35
• Classes of Test Inputs
36
Test Month Day Year Expected Output
Case ID
T101 5 20 1996 21- 5 -1996
T102 0 13 2000 Invalid input
37
State Table based Testing
38
List of States in a Process
39
State Table Based Testing
40
State Table Based Testing
• State Table
41
State Table Based Testing
42
Decision Table based testing
43
Decision Table Based Testing
44
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.
45
Decision Table Based Testing
46
A University is admitting students in a professional course, subject to
the following conditions:
Marks in Java >=70
Marks in C++>=60
Marks in OOAD >=60
Total in all three subjects >=220 or Total in Java and C++>=150
If the aggregate mark of an eligible candidate is more than 240, he will
be eligible for scholarship course, otherwise he will be eligible for
normal course. The program reads the marks in the three subjects and
generates the following outputs:
•Not eligible
•Eligible for scholarship course
•Eligible for normal course
49
Error Guessing
• Error guessing is the method used when all other methods fail
• It means error or bug can be guessed which do not fit in any of the
earlier defined situations.
50