Several tools exist in the client which can aid in debugging and testing
Allows the client to show which commands are actually being executed, how they are being parsed, and what alias and variable substitutions are taking effect.
Causes the client to “pretend” it received a given line of text from the server. Use with caution.
Causes a given hook to be triggered as if the event had actually occurred.
inbound (not officially supported)
Shows all data received from the server. This generates a lot of duplicate output.
outbound (not officially supported)
Shows all data sent to the server. This generates a lot of output.
About the only time you should use this, at the command line to see if a fragment of code behaves as expected.
Adding a few well placed /echo statements are a good way to check to make sure that things are as they seem. You can use them to make sure code that is supposed to be executed really is, and to check on the state of variables.
These provide a way to unload scripts, saving you repeated restarts of the client.
Purge hooks, variables, and or aliases. This can be used to restore the client to a known state.
There is also a contributed script, debug.irc included with the client.
This serves as an example of how to use /set debug debugging modes in a script
with a large number of /on hooks to debug only specific sections of code.