A Structural Approach for Testing Causality