Chapter IVb
Chapter IVb
Black box
Boundary value analysis
State transition testing
Decision tables
Dynamic Use case based testing
Experience-based techniques
Statement Coverage
White box
Branch Coverage
Condition Coverage
Path Coverage
Reviews/ walkthroughs
Control flow analysis
Static
Boundary analysis /1
- Boundary analysis extends equivalence class partitioning by introducing a rule for
the choice of representatives
- The edge values of the equivalence class are to be tested intensively
- Why put more attention to the edges?
- Often, the boundaries of values ranges are not well defined
or lead to different interpretations
- Checking if the boundaries were programmed correctly
- Please note:
Experience shows that error occur very frequently on the boundaries of value
ranges!
Defining boundary values
- Please note:
Instead of one representative for the valid EC, there are now
six representatives (four valid and two invalid)
Boundary analysis example 3b
- Basic scheme: choose three values to be tested
the exact boundary and the two neighboring values (within and outside the EC)
- Alternative point of view: since the boundary value belongs to the EC, only two
values are needed for testing: one within and one outside the EC
- Example 3b:
- value range for a discount in %: 0.00 ≤ x ≤ 100.00
- valid EC: 0.00 ≤ x ≤ 100.00
- boundary analysis
additional representatives are: -0.01; 0.00; 100.00; 100.01
0.01 – same behavior as 0.00
99.99 - same behavior as 100.00
- A programming error caused by a wrong comparison operator will be found with the
two boundary values
Decision Table
Decision table testing
- Equivalence class partitioning and boundary analysis deal
with isolated input conditions.
- However, an input condition may have an effect only in
combination with other input conditions.
- All previously described methods do not take into account the
effects of dependencies and combinations.
- Using the full set of combinations of all input equivalence
classes usually leads to a very high number of test cases (test
case explosion).
- With the help of cause-and-effect graphs and the decision
tables derived from them, the amount of possible
combinations can be reduced systematically to a subset.
- A cause-and-effect diagram uses a formal language
- A cause-and-effect diagram is created by translating the (mostly
informal) specification of a test object into a formal language
- The test object is subject to a certain amount of effects that are
traced back to their respective causes
- Elements/symbols:
- Assertion (If cause A – then effect E)
A E
B
- Inclusive (At least one of two causes: A or B)
I A
B
- One and only one (One and exactly one of two causes:
A or B) O A
B
- Required (if cause A then also cause B)
A
R
B
- Example 5: Online-Banking
The user has identified himself via account number an PIN.
If having sufficient Coverage, he is able to set a transferal. To do this
he must input the correct details of the Recipient and a valid TAN.
Coverage
Do transferal
˄
Correct Recipient
TAN marked as us
˄
͠ v
͠ Deny transferal
Valid TAN
Request again TA
͠
T01 T02 T03 T04 T05
- The different states that a test object can take on are modeled using
state transition diagrams
- State transition analysis is used to define state transition based test
cases
State transition testing
- To determine test cases using
a state transition diagram a dead dead
transition tree is constructed:
- The initial state is the root married married
of the tree ͵͵ to die ʹʹ ͵͵ to die ʹʹ
͵͵ to marry ʹʹ ͵͵ to marry
- For every state that may be
divorced widowed
reached from the initial state,
A node is created which is ͵͵ d o p ʹʹ
͵͵ getting divorced ʹʹ
connected to the root by a branch married dead
- This operation is repeated and ͵͵ to die ʹʹ
͵͵ to marry ʹʹ
comes to an end if
- the state of the node is an single dead
͵͵ to die ʹʹ
end state (a leaf of the tree) ͵͵ be single ʹʹ
Or
- the same node with the same unborn
state is already part of the tree
Event. ͵͵ d o p ʹʹ : death of partner
IV – Test Design Technique
03 – Black box techniques
dead
single
error
unborn
Use case based testing
- Test cases are derived directly from the use cases of the test object
- The test object is seen as a system reacting with actors
- A use case describes the interaction of all involved actors leading to
an end result of the system
- every use case has pre-conditions that have to be met the in order to
execute the use case (the test case) successfully
- Every use case have post-conditions describing the system after
execution of the use case (the test case)
- Use cases are elements of the unified modeling language UML*
- Use case diagram are one of 13 different types of diagrams used by
UML
- A use case diagram is a diagram is a diagram describing a behavior,
it does not describe the sequence events
- It shows the system reaction from the viewpoint of user
UML is a non-proprietory specification language for object modeling
Use case based testing
- Example of a simple use case diagram (source: Wikipedia)
Drink
Wine
Cashier Pay for
Food
Use case based testing
- Every use case describes a certain task (user-system-interaction)
- Use case descriptions include, but are not limited to:
- Pre conditions
- Expected results/system behavior
- Post: conditions
- These descriptive elements are also used to define the corresponding test
cases
- Every use case may be used as the basis for a test case
- Every alternative within the diagram corresponds to a separate test case
- Typically, information provided with a use case has not enough detail to
define the test case directly, Additional data is needed (input data,
expected results) to make up a test case