Can a teacher run tests that the students don't see?

I’d like to run tests on student project/assignment code after they have submitted it. I only see documentation for how to create tests that the students can see and run.

1 Like

Easly no. The way I thought of is much harder and time consuming. You need to fork each repl and make a new test for each one then run it for each repl.

1 Like

I’m just brainstorming here (I haven’t tested this). Junit has the ability to do nested tests. I’m wondering if you could use this to obscure the test values.

1 Like

I just realized that you didn’t mention which language your students are working with. Mine are learning Java, which uses JUnit for testing. Other languages might have something similar in their unit testing platforms.

If you’re looking to create unit tests that students can’t reverse engineer, you can do something like this in Python:

if not work: # replace work with a boolean expression you're checking

When is called, the error message doesn’t give any indication as to what it was testing, whereas the error message from self.assertEquals() tells you the expected and actual value.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.