Debug and unit test for client rule testing and bug fixing