Functional Testing

17
Functional Testing

description

 

Transcript of Functional Testing

Page 1: Functional Testing

Functional Testing

Page 2: 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)

Page 3: Functional 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

Page 4: Functional Testing

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

Page 5: Functional 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

Page 6: Functional Testing

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

Page 7: Functional Testing

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]

Page 8: Functional Testing

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

Page 9: Functional Testing

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

Page 10: Functional Testing

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:

Page 11: Functional Testing

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

Page 12: Functional Testing

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].

Page 13: Functional Testing

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.

Page 14: Functional Testing

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

Page 15: Functional Testing

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:

Page 16: Functional Testing

Decision Table Based Testing (3) The test cases derived from Decision table:

Page 17: Functional Testing

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”