Sei sulla pagina 1di 25

Cause Effect Graphing

Introduction
• Cause-Effect Graph graphically shows the
connection between a given outcome and all
issues that manipulate the outcome.
• Cause Effect Graph/ fish bone diagram is a black
box testing technique.
• It tests external behavior of a system that aids
in choosing test cases that logically relate
Causes (inputs) to Effects (outputs) to produce
test cases.
• A “Cause” stands for a separate input
condition that fetches about an internal
change in the system.
• An “Effect” represents an output condition, a
system transformation or a state resulting
from a combination of causes.
When to use Cause Effect Graph?
• To determine the current problem so that
right decision can be taken very fast.
• To narrate the connections of the system with
the factors affecting a particular process or
effect.
• To recognize the probable root causes, the
cause for a exact effect, problem, or outcome.
Benefits
• It finds out the areas where data is collected for additional
study.
• It motivates team contribution and uses the team data of the
process.
• Uses synchronize and easy to read format to diagram cause-
and-effect relationships.
• Point out probable reasons of difference in a process.
• It enhances facts of the procedure by helping everyone to
learn more about the factors at work and how they relate.
• It assists us to decide the root reasons of a problem or quality
using a structured approach.
Steps to proceed on Cause-Effect Diagram

• Recognize and describe the input conditions


(causes) and actions (effect)
• Build up a cause-effect graph
• Convert cause-effect graph into a decision
table
• Convert decision table rules to test cases. Each
column of the decision table represents a test
case
Symbols used in Cause-effect graphs
Just assume that each
node having the value
0 or 1 where 0 shows
the ‘absent state’ and
1 shows the ‘present
state’.
The identity function
states when c1 = 1, e1
= 1 or we can say if c0
= 0 and e0 = 0.
NOT function states that,
if C1 = 1, e1= 0 and vice-versa.

OR function states that,


if C1 or C2 or C3 = 1, e1 = 1 else e1
= 0.

AND function states that,


if both C1 and C2 = 1, e1 = 1, else
e1 = 0.

AND and OR functions are


permitted to have any number of
inputs.
Test cases can be designed for the triangle
problem
• Step-1: Recognize and describe the input conditions
(causes) and actions (effect).
• The causes allocated by letter “C” are as follows,
• C1: Side “x” is less than sum of “y” and “z”
• C2: Side “y” is less than sum of “x” and “z”
• C3: Side “z” is less then sum of “x” and “y”
• C4: Side “x” is equal to side “y”
• C5: Side “x” is equal to side “z”
• C6: Side “y” is equal to side “z”
• The effects designated by letter “e” are as
follows,
• e1: Not a triangle
• e2: Scalene triangle
• e3: Isosceles triangle.
• e4: Equilateral triangle
• e5: Impossible
• Step-2: Build up a cause-effect graph
• Step-3: Convert cause-effect graph into a
decision table
Conditions R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11

C1: X < Y+Z? 0 1 1 1 1 1 1 1 1 1 1

C2: X < Y+Z? X 0 1 1 1 1 1 1 1 1 1

C3: X < Y+Z? X X 0 1 1 1 1 1 1 1 1

C3: X=Y? X X X 1 1 1 1 0 0 0 0

C4: X=Y? X X X 1 1 0 0 1 1 0 0

C5: X=Y? X X X 1 1 0 0 1 1 0 0

C6: X=Y? X X X 1 0 1 0 1 0 1 0

e1: Not a Triangle 1 1 1

e2: Scalene 1

e3: IsoScele 1 1 1

e4: Equilateral 1

e5: Impossible 1 1 1
• Step-4: 11 test cases according to the 11 rules.
Test Case X Y Z Expected Result

1 4 1 2 Not a triangle

2 1 4 2 Not a triangle

3 1 2 4 Not a triangle

4 5 5 5 Equilateral

5 ? ? ? Impossible

6 ? ? ? Impossible

7 2 2 3 Isosceles

8 ? ? ? Impossible

9 2 3 2 Isosceles

10 3 2 2 Isosceles

11 3 4 5 Scalene
Decision Table
• Decision table testing is a software testing
technique used to test system behavior for
different input combinations.
• This is a systematic approach where the
different input combinations and their
corresponding system behavior (Output) are
captured in a tabular form.
• A Decision Table is a tabular representation of
inputs versus rules/cases/test conditions.
• Step-3: Convert cause-effect graph into a
decision table
Conditions R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11

C1: X < Y+Z? 0 1 1 1 1 1 1 1 1 1 1

C2: X < Y+Z? X 0 1 1 1 1 1 1 1 1 1

C3: X < Y+Z? X X 0 1 1 1 1 1 1 1 1

C3: X=Y? X X X 1 1 1 1 0 0 0 0

C4: X=Y? X X X 1 1 0 0 1 1 0 0

C5: X=Y? X X X 1 1 0 0 1 1 0 0

C6: X=Y? X X X 1 0 1 0 1 0 1 0

e1: Not a Triangle 1 1 1

e2: Scalene 1

e3: IsoScele 1 1 1

e4: Equilateral 1

e5: Impossible 1 1 1
• Step-4: 11 test cases according to the 11 rules.
Test Case X Y Z Expected Result

1 4 1 2 Not a triangle

2 1 4 2 Not a triangle

3 1 2 4 Not a triangle

4 5 5 5 Equilateral

5 ? ? ? Impossible

6 ? ? ? Impossible

7 2 2 3 Isosceles

8 ? ? ? Impossible

9 2 3 2 Isosceles

10 3 2 2 Isosceles

11 3 4 5 Scalene
Example 1: How to make Decision
Base Table for Login Screen
Let's create a decision table for a login screen.
Constraints/Conditions
• if the user provides correct username and
password the user will be redirected to the
homepage.
• If any of the input is wrong, an error message
will be displayed.
Conditions Rule 1 Rule 2 Rule 3 Rule 4

Username F T F T
(T/F)

Password F F T T
(T/F)

Output (E/H) E E E H

Legend:
T – Correct username/password
F – Wrong username/password
E – Error message is displayed
H – Home screen is displayed
Interpretation
• Case 1 – Username and password both were
wrong. The user is shown an error message.
• Case 2 – Username was correct, but the password
was wrong. The user is shown an error message.
• Case 3 – Username was wrong, but the password
was correct. The user is shown an error message.
• Case 4 – Username and password both were
correct, and the user navigated to homepage
• While converting this to test case, we can create 2 scenarios ,
• Enter correct username and correct password and click on
login, and the expected result will be the user should be
navigated to homepage
• And one from the below scenario
• Enter wrong username and wrong password and click on
login, and the expected result will be the user should get an
error message
• Enter correct username and wrong password and click on
login, and the expected result will be the user should get an
error message
• Enter wrong username and correct password and click on
login, and the expected result will be the user should get an
error message
Why is Decision Table Testing is important?
• This testing technique becomes important when it is required to test
different combination.
• It helps in better test coverage for complex business logic.
• In Software Engineering, boundary value and equivalent partition are
other similar techniques used to ensure better coverage. They are
used if the system shows the same behavior for a large set of inputs.
• However, in a system where for each set of input values the system
behavior is different, boundary value and equivalent partitioning
technique are not effective in ensuring good test coverage.In this
case, decision table testing is a good option. This technique can make
sure of good coverage, and the representation is simple so that it is
easy to interpret and use.
Why is Decision Table Testing is important?

• This table can be used as the reference for the requirement


and for the functionality development since it is easy to
understand and cover all the combinations.
• The significance of this technique becomes immediately
clear as the number of inputs increases.
• Number of possible Combinations is given by 2 ^ n , where n
is the number of Inputs. For n = 10, which is very common in
the web based testing, having big input forms, the number
of combinations will be 1024. Obviously, you cannot test all
but you will choose a rich sub-set of the possible
combinations using decision based testing technique.
Advantages of Decision Table Testing
• When the system behavior is different for different input and not
same for a range of inputs, both equivalent partitioning, and
boundary value analysis won't help, but decision table can be used.
• The representation is simple so that it can be easily interpreted and
is used for development and business as well.
• This table will help to make effective combinations and can ensure a
better coverage for testing
• Any complex business conditions can be easily turned into decision
tables
• In a case we are going for 100% coverage typically when the input
combinations are low, this technique can ensure the coverage.
Disadvantage of Decision Table Testing

• The main disadvantage is that when the


number of input increases the table will
become more complex

Potrebbero piacerti anche