&gt; You can work around some of the debugging complexity by outputting each stage to a suitable format so you can test each transformation individually, but it&#x27;s still hard to keep track of exactly what each stage expects and delivers.<p>Honestly this sounds like a good case for a type system - which of course isn&#x27;t available in ruby.