Input/Outputing Testing & Autograding

Wade Bourne

Wade Bourne

Derrick McMillen

Derrick McMillen

Today, a highly requested feature has been released: Input/Output testing & autograding. The Input/Output Tests pane is embeded within all new and existing Teams for Education projects.

input/output tests
input/output tests

This pane contains tools designed to simplify testing code. Instead of manually entering typing input and checking output for every submission, the autograder allows you to define and automate testing.

How do I use it?

Input/Output tests is only available for projects created within the Teams for Education product. This feature is available on all projects - new and existing.

Click on the icon within the workspace sidebar nav to reveal the Input/Output tests pane.

checkmark
checkmark

Click on the button to reveal a form with the following fields:

create test button
create test button
create test form
create test form
  • Test name - This is the name of the test, which is for you and your students to identify it.
  • Input (optional) - This is where you put in the input for your test.
  • Expected output - This is the output which the program is expected to have.
  • Type (default: match) - This is how we represent how we compare the actual output of the script with the expected output.
    • match - The test passes if the expected output is in (or equal to) the actual output. The JavaScript equivalent is actualOutput.includes(expectedOutput).
    • exact - The test passes if the expected output is equal to the actual output. (though, we allow a trailing newline). The equivalent to this in JavaScript is expectedOutput === actualOutput || expectedOutput + '\n' === actualOutput.
    • regex - The test passes if the test matches the expectedOutput compiled as a regex. This is equivalent to actualOutput.match(expectedOutput).

If you don't want to be lenient of an extra newline and have a truly exact match with the expectedOutput and actualOutput, you can use the regex with a ^ at the start and $ at the end. Keep in mind though, that you'll have to escape other regex characters.

Tests cases can be added, edited, and deleted at any time - even after the project has been published. This added flexibility allows you to get started with testing right away.

If a test fails, you can view the results by clicking that appear on each test case:

results button
results button

input output test failed
input output test failed

What if I want to add tests to a pre-existing project?

All changes applied to Input/Output tests within a project will be applied to the submissions automatically. Students will not need to refork to the original project to use updated test cases from their instructors.

Migrating from Repl.it Classroom

Input/Ouput tests created within Repl.it Classroom assignments can now be migrated to Teams for Education using the Classroom Migration Tool.

If you migrated your Classroom since 12/11/2020, you'll see your input/output tests in your new Team. If you migrated your Classroom before then, you'll be able to migrate your Classroom again.

Giving Feedback Goes a Long Way

Teachers continue to express their enthusiasm for multiplayer Repls, annotations, and group projects. We will continue to build on these new platform features to provide a seamless collaborative experience for project based learning.

Are you dreaming of Repl.it features to make you a superhero in your classroom? We want to hear about it! Contact Derrick McMillen directly via email. You can also leave feedback for us via Canny.

replbot
replbot

Learn more about Teams for Education in our documentation.

More