Debugging Techniques

Stratego -- Strategies for Program Transformation
Here are some debugging techniques

  • Reduce the specification and the input to localize the error

Format Checking

Unit Testing

  • Write a unit test using StrategoUnit?


  • Print intermediate results using debug

  • 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.



  • Compare your code with the list of PitFalls