0

Here is my scenario: I'm in the process of creating a plugin that lets my students submit their code via SBT (a different subject) to one of my custom CI servers, and I would like to be able to include a subset of the test cases used for grading (e.g., JUnit or ScalaUnit tests) along with each project. Preferably, I'd like these test cases to be compiled, and I'd like for students to be able to execute them using a task/goal similar to sbt test.

Two Questions (and perhaps some more):

  1. What's the easiest way to accomplish this?
  2. What's a secure way to implement this?

Right now, I'm thinking of including a JAR file with each assignment that contains a subset of the test cases. I can write a plugin that forks the JVM and executes the test cases and reports the results. This leads to the following questions:

  1. Would it be better to setup my own Maven/Ivy repository the assignment test cases and have the plugin include them on a per-assignment basis?
  2. Can SBT do this without me having to write a plugin?

Thanks!

1 Answer 1

1

Something very similar to this was done for the Functional Programming principles in Scala with Martin Odersky at the EPFL. They used two sets of tests, one which were published with the code, which the students could run while coding (using sbt test), and one set which lived on the server, which were run when the code was published. The second (server) was the one which produced the report and gave the grade. This was fed back using the coursera site, but you can always send a mail or something. The server wasn't done synchronously, it was done as part of a batch.

The code was also graded based for various style points using Scalastyle.

Don't base your grades on the code which is executed on the student machines. This isn't secure.

Yes, you can do this without using a plugin, you just include the code directly in your Build.scala. This is probably the easiest way.

Not the answer you're looking for? Browse other questions tagged or ask your own question.