Cause and Effect Graph – A Comprehensive Testing Approach
Test case authoring is a fundamental aspect of both manual and automated testing. Every project involves a unique set of test conditions that ought to be addressed.
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
When authoring test cases, we should concentrate on two elements:
- Risk Mitigation
- Enhancing Test Coverage
This article focuses on enhancing “Coverage”, specifically Requirement Coverage.
What You Will Acquire:
Test Case Authoring Techniques For Dynamic Testing
- Equivalence Partitioning
- Boundary Value Analysis
- Decision table
- Cause and Effect Graph Method
- State Transition Diagram
- Orthogonal Array Testing (OATS)
- Error Guessing
We possess some insightful articles regarding the first three points (Equivalence Partitioning, BVA, and Decision tables) here at STH. Today, we will be discussing the Cause and Effect graph, which is the fourth point.
Overview of Cause And Effect Graph
The Cause and Effect Graph is a potent test case authoring methodology. Here, the input conditions are identified as causes, and the outcomes of these input conditions are recognized as effects.
No time to read? Learn More About Dynamic Testing Here =>>
The Cause-Effect Graph method decreases both test execution time and cost by establishing the least possible test cases for maximizing test coverage. It seeks to cover the necessary test cases required to achieve the desired application quality, all the while reducing the number of total test cases.
Nonetheless, using this technique has certain setbacks. It requires time to model the entire requirements into the Cause-Effect Graph prior to penning down the test cases.
This technique reinterprets the requirements specification using Boolean operators like AND, OR, and NOT to define logical connections between input and output conditions.
Notations Employed:
Let’s experiment with this technique using a few examples:
- Create a Cause and Effect graph based on given requirement/situation.
- Given a Cause and Effect Graph, form a Decision table based on it to infer the test case.
Let’s have a look at each of them one after the other.
Create A Cause And Effect Graph as Per the Situation
Situation:
The “Print Message” program reads two characters and performs messages according to their values.
- The foremost character must be either “A” or “B”.
- The subsequent character must be numeric.
- If the first character is either “A” or “B” and the second character is a numeral, the file must be refreshed.
- If the first character is wrong (not “A” or “B”), the message “X” must be administered.
- If the latter character is incorrect (not a digit), the message “Y” must be administered.
Solution:
The Causes for this situation are:
C1 – Foremost character is A
C2 – Foremost character is B
C3 – Subsequent character is a numeric value
The Effects (outcomes) for this situation are:
E1 – Refresh the file
E2 – Administer message “X”
E3 – Administer message “Y”
LET’S COMMENCE!!
Firstly, represent the Causes and Effects as illustrated below:
A fundamental technique – Always traverse from Effect to Cause (left to right). This means, to acquire the effect “E”, ascertain the causes that should be validated.
In this example, we’ll start with Effect E1.
Effect E1 denotes refreshing the file. The file is refreshed when:
- The foremost character is “A” and the subsequent character is numeric.
- The foremost character is “B” and the subsequent character is numeric.
- The foremost character could be either “A” or “B”, but not both.
Now let’s symbolize these points:
For E1 to be validated, the following must be the causes:
- C1 and C3 should be valid.
- C2 and C3 should be valid.
- C1 and C2 cannot be valid concurrently. This suggests that C1 and C2 are mutually exclusive.
Now let’s illustrate this:
So, as indicated by the above diagram, for E1 to be valid, the condition is (C1 C2) C3
The circle in the middle depicts the mid-point to make the graph more comprehensible.
The third condition, where C1 and C2 are mutually exclusive results in the final graph for effect E1 to be validated, which is revealed below:
Proceeding to Effect E2:
E2 implies administering message “X”. Message “X” will be printed when the First character is neither “A” nor “B”.
This suggests Effect E2 will transpire when either C1 OR C2 is invalid. So the graph for Effect E2 is depicted in blue:
As for Effect E3:
E3 represents administering message “Y”. Message “Y” will be administered when the Second character is incorrect.
This means Effect E3 will occur when C3 is invalid. So the graph for Effect E3 is shown in green:
Completion of the Cause and Effect graph for the above-mentioned situation.
The following step entails creating the Decision table dependent on the former graph.
Formulating a Decision Table Grounded On the Cause And Effect Graph
Firstly, enlist the Causes and Effects in a single column as revealed below
The principle remains the same. Proceed from bottom to top, which implies traverse from Effect to Cause.
Start with Effect E1. For E1 to be valid, the condition is (C1 C2) C3.
Here, Valid is denoted as 1 and Invalid as 0
Initially, endorse Effect E1 as Valid in the next column as
Now, for E1 to be “1” (valid), we have the following two mandates:
- C1 AND C3 will be valid
- C2 AND C3 will be valid
For E2 to be Valid, C1 or C2 must be Invalid, demonstrated as: