Reference solutions instead of tests: the algorithms course in our third year
In my first year I was really struck that two completely different audiences had come to the prestigious University of Latvia. The first were olympiad people and mathematicians who, honestly, programmed better than the teachers: come on, load us up with work. The other half were strangers to computers. They knew school maths well and came to learn from the very beginning: here’s writeln, here’s if, here’s begin and end. The courses were pitched at the second group, and for a long time we in the first were bored.
Only in the third year did we finally get to what we had wanted to do from the very first: an algorithms course where you solve problems. It was taught by Guntis Arnicāns, the same man we travelled with to ACM ICPC in Minsk and St Petersburg.
He told us: “Guys, there’s no point giving you tests, you know all this already. You don’t even have to come to the lectures. But you’ll have to pass the exam; that’s the policy.” And in return he asked us to write reference solutions.
He checked the other students’ problems olympiad-style: a student writes a program, and it is run on tests. We wrote the reference solutions, which had to pass 100% of the tests. When needed, he used them to show how to solve the problem properly.
I think he was the most worthy teacher at the university. To the point, practical and modern: automatic testing, not “I looked at it, ugh, that’s not how you write it”.
What I took from it: the best way to teach strong students is to give them real work. And the best way to check code is tests, not the checker’s opinion.