FunctionalTesting Updated
FunctionalTesting Updated
Functional Testing
Sumit Dhameliya
sdhameliya@conestogac.on.
ca
Course Outline
7.1:
Describe the principles and the role of
functional testing in a development project
7.2:
Apply functional testing techniques using
boundary condition analysis, decision tables,
and/or randomized testing as applicable
Outline
Equivalence classes
Figure 9.8: (a) Too many test inputs; (b) One input is selected from each of the
subdomains
Test Cases and Equivalence
Classes
Test
cases for each equivalence class can be
identified by:
Assign a unique number to each equivalence class
For each equivalence class with valid input that has not
been covered by test cases yet, write a new test case
covering as many uncovered equivalence classes as
possible
For each equivalence class with invalid input that has
not been covered by test cases, write a new test case
that covers one and only one of the uncovered
equivalence classes
Advantages of Equivalence
Classes
A small number of test cases are needed to cover a large input
domain adequately
One gets a better idea about the input domain being covered with
the selected test cases
For
example, we may construct test cases for values that have
one of the following:
Minimum value
Just above the minimum value
Maximum value
Just below the maximum value
Nominal (average) value
Robustness Testing
Robustness testing is an extension to boundary value analysis
Systematically test the program with both valid and invalid values,
either singly or in combination
Decision
tables provide a systematic way to define a
number of different complex business rules
Help
to define what would be the best cases to test, as
sometimes the number of combinations can be huge
CUSTOMER
If the customer is a new customer, offer 20% discount on
next order
If the customer is a repeat customer, offer free shipping
Stub Entry
New Customer T T T T F F F F
High risk level
T T F F T T F F
of goods
Past orders total
> 350 T F T F T F T F
20% discount
next order X X X X
Free shipping X X X X
Check credit
X X X
history
Limited Entry and Extended Decision
Tables
In
the second column, next to each condition, we have each
column's possible values
In
a limited entry decision table, conditions are binary values
restricted to "True" or "False."
These are sometimes replaced by the values Yes (Y) and No (N)
In
an extended entry decision table, a condition may have many
possible values
Stub Entry
Customer Type New Customer Repeat Customer
Conditio
Risk level of goods High Risk Low Risk High Risk Low Risk
n
Past orders total > <=35 > <= > <= > <=
350 0 350 350 350 350 350 350
20% discount next
order X X X X
Action
Free shipping X X X X
Check credit
X X X
history
Action
Sets
Example Decision Table – Adding Don't
Cares
Stub Entry
Customer Type New Customer Repeat Customer
Conditio
Risk level of goods High Risk Low Risk High Risk Low Risk
n
Free shipping X X X X
Check credit
X X X
history
The "-" indicates a "don't care" condition that does not affect any of the
documented actions.
Steps in Developing a Decision Table
for Testing
Step1: The test designer needs to identify the conditions
and the effects for each specification unit.
A condition is a distinct input condition or an equivalence class of
input conditions
An effect is an output condition
1 As a new customer that purchases a Verify that the customer is provided with
high risk level of goods, regardless of a 20% discount on the next order and a
past order total check of their credit history is
performed.
2 As a new customer that purchases a Verify that the customer is provided with
low risk level of goods, regardless of a 20% discount on the next order only.
past order total
3 As a repeat customer that purchases a Verify that the customer is provided with
high risk level of goods, with a past free shipping only.
order total of $351
4 As a repeat customer that purchases a Verify that the customer is provided with
high risk level of goods, with a past free shipping and a check of their credit
order total of $350 history is performed.
Questions?