The approach I've been using is that I test against a corpus of questions with known answers. Using sample-and-vote, that is asking for some number of variable completions with a non-zero temperature and treating the explicitly computed solutions as votes, has smoothed over issues with basic syntax and logic errors.
This is pretty similar to the approach used in the Toolformer paper, other than sample-and-vote, which I believe is novel.