I am working on a grading script to grade students’ submission. The general idea currently is loading a submission file in toplevel and running testcases on many functions in that submission file.
I choose toplevel is due to some functions in submission may have type error. Saying one function in submission accepts only one argument but in fact it needs two arguments. If I try compiling the submission together with grading code, type error will stop the whole compiling. However, if I run it in toplevel, only this testcases fail, and the following testcases can still run, which may give them partial credits.
This is the background. My questions is:
- Is it possible to catch type error in toplevel? If I could this, I can give better feedback
- Could some test framework like OUnit help? I admit using toplevel is somewhat hacking. The tricky part is I have to be enough tolerable to submission files.