On CodeHS, you have two options for autograding Java assignments: the Java Autograder and the JUnit Autograder.
- The Java Autograder is a custom-built tool designed specifically for use on CodeHS. It allows you to analyze student code before execution—checking for specific variable names, method existence, and structural elements—while also running the code to validate console output and behavior. This option is ideal for assignments that require both code analysis and runtime verification.
- The JUnit Autograder leverages the industry-standard JUnit framework to test Java programs. It is best suited for assignments that focus on testing methods and object-oriented design, where students are expected to write code that passes predefined unit tests.
Both autograders have their strengths, and the choice depends on the type of assessment you want to create.
If you need to inspect the structure of student code in addition to testing functionality, the Java Autograder is the better choice. If you want to evaluate student code using formal unit tests and/or have private sector coding experience, the JUnit Autograder provides an approach more consistent with industry norms.
Creating Java Autograders
Creating JUnit Autograders