Debugging Techniques
Stratego -- Strategies for Program Transformation
Here are some debugging techniques
- Reduce the specification and the input to localize the error
- Print intermediate results using
debug
- Write a unit test using StrategoUnit?
- Compare your code with the list of ThingsThatCannotWork?
- Use the debug strategy with an argument. It turns out that the debug strategy will accept a string prefaced by an exclamation mark, thus: debug(!"after doing something or other: ") If you do this, it will print the current aterm as usual, but first it will print the string, so that you know where in the program it is.