How can you tell if you have a corrupt rule?

How can you tell if you have a corrupt rule? I've seen warnings about using the back button and some other things, but how can you be sure if a rule doesn't work (either when you create it or later if it seems to misbehave) that there's not some hidden gremlin? Should I start a new rule from scratch?

I've tried twice to clone a working rule to edit it for other situations, but it seems like I'm not able to edit simple things easily, like changing my Thermostat Mode from "cool" to "heat" in a cloned rule.

Anyway, I have some things working well already. It's just getting the hang of more complex rules is taking a lot of trial and error.

Click the run action button for testing within the rule

A 'corrupt rule' can take on several different cases.

Early in RM 5.0 I was having issues in building the rules where certain sequences of editing conditional statements would result in broken code and the RM 'rule builder' wouldn't function. Exiting and going back into the rule didn't work, the only option was to delete the rule and start over. It appears this has been corrected in subsequent updates/RM 5.1 where the rule editor follows a more deliberate sequence. I haven't had this problem at all recently.

Deleting device or variable elements of a rule (skipping the warning statement) or importing a rule without the associated hub variables will result in a rule with required segments missing. Those are usually identified by Broken action or something similar in the rule itself. In my experience, adding the required element can fix those rules, or deleting the associated rule portions and adding them back in completely will also fix those rules.

As @rlithgow1 stated, if you are referring to a rule that doesn't perform as expected, then full logging and RUN ACTION can help you debug.

I'm just now starting to use rule import/cloning etc. I have 4 hubs I'm running at different properties and I'm using those functions to add features to other hubs. The import/export function is challenging code, particularly when the rules have to match devices on a new hub (or even existing). My advice is to edit the individual rule ACTIONS associated with the device that isn't working. reselect the device and make sure it is mapped to the rule. Open the device, make sure it operates from the device page action buttons, then make sure the rule you are running is mapped at the bottom of the device page.

I had an issue where a rule 'restore' was duplicating my devices (same name/etc). I had to remove the duplicated instances, and make sure the rule portions were all mapped to the same device instance. Most of those were virtual devices, but it also happened with actual z-wave devices. If the device was referenced several places in the rule, each instance had to be edited and remapped.