Cause-effect graph example
The "Print message" is a software that read two characters and, depending of their values, messages must be printed.
- The first character must be an "A" or a "B".
- The second character must be a digit.
- If the first character is an "A" or "B" and the second character is a digit, the file must be updated.
- If the first character is incorrect (not an "A" or "B"), the message X must be printed.
- If the second character is incorrect (not a digit), the message Y must be printed.
Causes:
- 1 - first character is "A"
- 2 - first character is "B"
- 3 - second character is a digit
Effects:
- 70 - the file is updated
- 71 - message X is print
- 72 - message Y is print
In order to check if the graph is correct, the causes must be assigned the values 0 or 1, and the effects must be checked if they take the correct value. For those values combinations that are not possible, the graph must be annotated with constraints.
Afterwards, the graph must be converted to a decision table.
Nodes | Test case | Test case | Test case | Test case | Test case | |
---|---|---|---|---|---|---|
Cause | 1 | 0 | 0 | 1 | 0 | 1 |
Cause | 2 | 0 | 0 | 0 | 1 | 0 |
Cause | 3 | 0 | 1 | 1 | 1 | 0 |
Effect | 70 | 0 | 0 | 1 | 1 | 0 |
Effect | 71 | 1 | 1 | 0 | 0 | 0 |
Effect | 72 | 1 | 0 | 0 | 0 | 1 |