Ability to Run Unit Tests Individually

I am a teacher using repl.it teams for education. I would really like the ability to allow my students to run unit tests individually. Occasionally, I create tests to act as different milestones for different stages of their projects. If they have not implemented certain parts of the project, it will prevent the tests from being able to compile and execute.

For example, in our object-oriented programming unit, I will have them create multiple classes to implement a project. Since there are tests for each one of their classes, the tests won’t be able to compile and run until they have implemented all classes. Since their classes or certain methods in their classes may not be implemented, it will cause compilation errors. It would be great if they were able to pick and choose which tests to run, so they could test along the way without running into test compilation errors.

As a teacher, it would also be great to be able to rearrange the order of the tests, since the tests are run in the reverse order that they are created. Would this be possible?

You can just run the tests, and despite only a few tests being able to work, they will be able to see which tests have failed (IIRC someone should fact-check). If you are doing a project, you can keep working on it until you get to the end in which your students would have already completed the program.

Thanks for your response! This is not true in the situations I am talking about. I am having the students build their own classes in Java. If they have not built all the classes yet or all the methods for those classes, the tests will not compile and run. That is because it can’t find the class or the method that it is trying to test. If we could selectively run specific tests, it would allow them to individually test their classes without having to have everything done.

I would also like to add that junior programmers - young students who know nothing about crazy output on a console - get overwhelmed when the tests “fail” but it’s just the tests running on code they haven’t finished yet. A play button next to each specific test would go a long way to alleviating this for many students.

1 Like