Post on 06-Mar-2018
Functional Testing
Complete Testing is not all possible We may like to reduce this incompleteness as much as possible.
What we are looking for is a set of thought processes that allow us to select a set of data more intelligently.
(the poorest methodology is random input testing)
What is Functional Testing? Functional Testing (also know as Behavior testing) is
based on the Functionality of the program. It is involves only observation of the output for certain input values. There is no attempt to analysis the code, which produces the output
Functional Testing also referred as Black Box Testing
Output testdata
SystemUndertest
Input testdata
Input domain Ouput domain
Techniques used to design Test Cases for Functional Testing
Boundary Value Analysis
Equivalence Class Testing
Decision Table Base Testing
Cause Effect Graphing Technique
Special Value Testing
Boundary Value Analysis (1) Experience show that test cases that are close to boundary
condition have higher chances of detecting an error. Boundary condition means: an input value may be on the
boundary, jut below the boundary (upper side) or just above the boundary (lower side).
Based on “Single Fault” assumption
Boundary Value Analysis (2) Uses input variable values at their:
Minimum Just above minimum Nominal value Just Maximum Maximum
Test cases are obtained by Combine values of one variable with the nominal values of
remain variables Repeat above step until all variable are traversed
There are 4n+1 test cases for a program has nvariables
0
100
200
300
400
100 200 300 400
Boundary Value Analysis (3) Assume we have a program with two input
variables, which have any value from 100 to 300 Test cases are: (200,100), (200,101), (200, 200), (200,
299), (200, 300), (100, 200), (101, 200), (299, 200), (300, 200)
Generate Test cases for the program that determination of the nature of roots of quadratic equation. Values of coefficients are ranged from 0 to 100. The program may outputs one of following words: Not a quadratic equation, Real Root, Imaginary Root, Equal Root. [Show Result]
Robustness Testing (1) The extension of boundary value analysis We would like to see what happen when the
extreme values are exceeded Total test cases: 6n + 1 Robustness test cases
for 2 variables x, y with range [100,200]
0
100
200
300
400
100 200 300 400
Robustness Testing (2)(200,99), (200,100), (200,101)(200,200), (200,299), (200,300)(200,301)
(99,200), (100,200),(101,200)(299,200),(300,200),(301,200)
0
100
200
300
400
100 200 300 400
Worst-Case Testing Reject “single fault” assumption theory of
reliability We would like to see what happen when more than
one variables has an extreme value. Require more effort Total test cases for Worst-case testing: 5n
Example:
Equivalence Class Testing(1) Input domain of a program is partition into a finite
number of equivalence classes The equivalence classes are identified by taking
each input condition and partitioning it into valid and invalid classes
Generate the test cases using the equivalence classes .
This performed by writing test cases covering all the valid equivalence classes. Then a test case is written for each invalid equivalence class (no test case contain more than one invalid class
Equivalence Class Testing(2) Example: For a program that supposed to accept any
number between 1 and 99: There are four equivalence classes form input side
Any number between 1 and 99 is valid input Any number less than 1 (invalid input) Any number greater than 99 (invalid input) If it not a number, it should not be accepted
The test cases are: (50), (-1), (100) Example:
1. Generate test cases for the program that accept any three integer numbers in range [100..200]
2. Generate test cases for the program that determine the nature of root of a aquaratic equation (a, b, c are in range [0..100].
Equivalence Class Testing(3)
Most of the time, equivalence class testing defines Most of the time, equivalence class testing defines classes of the input domain. However, equivalence classes of the input domain. However, equivalence classes should also be defined for output domain. classes should also be defined for output domain.
Decision Table Based Testing (1) Useful for describing situation in which number of
combinations of actions are taken under varying sets of condition
Four portions of decision table: Conditions stub, Action stub, Condition entries, Action entries.
ConditionStub
Entry
c1 True False
c2 True False True False
c3 True False True False True False True False
Action stub
a1 X X X
a2 X X X
a3 X X
a4 X X X
Decision Table Based Testing (2) To identify test cases with decision tables we interpret
condition as input, and action as output. Example: Decision table for triangle program:
Decision Table Based Testing (3) The test cases derived from Decision table:
Ad Hoc Testing Testing carried out using no recognized test case design
technique.
Also known as Special value testing.
Mostly intuitive and least uniform.
It occurs when the tester uses domain knowledge experience
and information about soft spots to derive test cases.
Dependent on the abilities of the tester.
Other terms: “hacking”, “out-of-box testing”