Cause-effect graphing is a test design technique used to derive test cases by modeling logical relationships between input conditions (causes) and system responses (effects).

How It Works

  1. Identify Causes and Effects
    • Causes: Boolean input conditions (e.g., a = b, a < b + c)
    • Effects: System outputs or behaviours (e.g., “Isosceles”, “Not Triangle”)
  2. Draw a Boolean Graph
    • Link causes to effects using logical connectors:
      • AND: All connected causes must be true
      • OR: At least one cause must be true
  3. Add Constraints
    • Indicate impossible combinations (e.g., a triangle can’t have negative side lengths)
  4. Convert the Graph into a Decision Table
    • Identify all cause combinations that lead to each effect.
    • Each valid combination becomes a test case.

Example

You are testing a triangle classifier.

def triangle(a: int, b: int, c: int) -> str:
	...

Identify causes and effects

Causes: c1: a < b + c c2: b < a + c c3: c < a + b c4: a = b c5: a = c c6: b = c

Effects: e1: “Not Triangle” — triangle inequality violated e2: “Scalene” — all sides different e3: “Isosceles” — two sides equal e4: “Equilateral” — all sides equal e5: “Impossible” — mutually exclusive constraints

Draw a boolean diagram

Convert graph into decision table

E1: Not triangle

ConditionsR1R2R3
c1: a < b + cFTT
c2: b < a + c-FT
c3: c < a + b--F
Output
e1: Not TriangleTTT

E2: Scalene

ConditionsR8
c1: a < b + cT
c2: b < a + cT
c3: c < a + bT
c4: a = bF
c5: a = cF
c6: b = cF
Output
e2: ScaleneT

E3: Isosceles

ConditionsR5R6R7
c1: a < b + cTTT
c2: b < a + cTTT
c3: c < a + bTTT
c4: a = bTFF
c5: a = cFTF
c6: b = cFFT
Output
e3: IsoscelesTTT

E4: Equilateral

ConditionsR4
c1: a < b + cT
c2: b < a + cT
c3: c < a + bT
c4: a = bT
c5: a = cT
c6: b = cT
Output
e4: EquilateralT

Combined decision table

ConditionsR1R2R3R4R5R6R7R8
c1: a < b + cFTTTTTTT
c2: b < a + c-FTTTTTT
c3: c < a + b--FTTTTT
c4: a = b---TTFFF
c5: a = c---TFTFF
c6: b = c---TFFTF
Outputs
e1: Not TriangleTTT
e2: ScaleneT
e3: IsoscelesTTT
e4: EquilateralT
e5: Impossible

Now, you can derive test cases based on the decision table as discussed in Decision Tables.


Back to parent page: Software Testing

Web_and_App_Development Software_Testing Blackbox_Testing SOFT3202 Decision_Table Cause_And_Effect_Graphing