Index
Blog

# Project 0 Testing

I’ve gotten a couple of questions via email about testing Project 0. There are all kinds of ways to do your testing and when I grade projects I will look first at your tests. If your tests are sufficient, I’m done. If not, I have a collection of tests that I will use. Note that your grade will not be lowered if your tests are not sufficient. You’re program will just be subjected to my tests.

A couple of things I would suggest trying. One is to define a main in your code and call your test cases from the main program. Have a few test cases for each interpreter or even the same test cases for each interpreter other than the 4th where you need to integrate the parser. Another approach is to just include test cases at the bottom of your file that execute when the file is loaded. This is quite simple to do by just calling your interpreters directly. Finally, an approach I like is defined your test cases as a list of terms. Them map your interpreters across the list. The resulting list will record the output of your tests.

If you want to use QuickCheck, have right at it. There are chapters in the online text that describe how to use QuickCheck. I’m not covering that information in class and you are not responsible for it, but there’s likely enough there to allow you to use QuickCheck. Interestingly, both QuickCheck and Parsec (parser tool) are monadic. They don’t use Maybe, but do implement the Monad typeclass.