https://github.com/purduecsbridge/percolator
:hotsprings: Java grading framework for Gradescope and Vocareum
https://github.com/purduecsbridge/percolator
autograder cs-education gradescope java vocareum
Last synced: 7 months ago
JSON representation
:hotsprings: Java grading framework for Gradescope and Vocareum
- Host: GitHub
- URL: https://github.com/purduecsbridge/percolator
- Owner: purduecsbridge
- License: mit
- Created: 2020-10-25T05:25:43.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-13T05:52:17.000Z (almost 3 years ago)
- Last Synced: 2023-02-25T06:53:14.969Z (over 2 years ago)
- Topics: autograder, cs-education, gradescope, java, vocareum
- Language: Java
- Homepage: https://purduecsbridge.github.io/percolator/api
- Size: 469 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Percolator
[](https://github.com/purduecsbridge/percolator/actions?query=workflow%3A%22Deploy%22+branch%3Amain)
[](https://purduecsbridge.github.io/percolator/api/latest)Percolator is a grading framework for Java programming assignments on Gradescope and Vocareum. It is meant to make the development and maintenance of programming assignments easier for courses using Java. How easy is it?
```java
import edu.purdue.cs.percolator.TestCase;import org.junit.Test;
public class HelloWorldTests {
@Test(timeout = 1000)
@TestCase(name = "Hello test", points = 50.0)
public void testHello() {
// Test code here
}
@Test(timeout = 1000)
@TestCase(name = "Goodbye test", points = 50.0)
public void testGoodbye() {
// Test code here
}}
```That's a test suite written using Percolator. Pretty simple, right? Call the `AutoGrader.run()` method to run your test suites and automatically print the results in JSON for Gradescope.
```java
import edu.purdue.cs.percolator.AutoGrader;public class TestRunner {
public static void main(String[] args) {
String[] testSuites = {HelloWorldTests.class, DebuggingTests.class};
AutoGrader.grade(testSuites).run();
}}
```You can customize the settings for the [AutoGrader](https://purduecsbridge.github.io/percolator/api/latest/edu/purdue/cs/percolator/AutoGrader.html) using its builder methods, including adding a code style checker.
```java
import edu.purdue.cs.percolator.AutoGrader;
import edu.purdue.cs.percolator.StyleChecker;public class TestRunner {
public static void main(String[] args) {
String[] testSuites = {TestSuiteOne.class, TestSuiteTwo.class};
StyleChecker codeStyleChecker = StyleChecker.lint(
"/autograder/submission", "/autograder/source/checkstyle.xml")
.withMaxScore(5.0)
.withDeduction(1.0);
AutoGrader.grade(testSuites)
.withMaxScore(95.0)
.withStyleChecker(codeStyleChecker)
.run();
}}
```The [StyleChecker](https://purduecsbridge.github.io/percolator/api/latest/edu/purdue/cs/percolator/StyleChecker.html) audits the Java source files in a given directory and enforces the rules defined in a [Checkstyle configuration](https://checkstyle.org/config.html).
By default, the [AutoGrader](https://purduecsbridge.github.io/percolator/api/latest/edu/purdue/cs/percolator/AutoGrader.html) will assume you are using Gradescope. If you are using Vocareum instead, just use the `onVocareum()` method when constructing your AutoGrader.
```java
import edu.purdue.cs.percolator.AutoGrader;public class TestRunner {
public static void main(String[] args) {
String[] testSuites = {TestSuiteOne.class, TestSuiteTwo.class};
AutoGrader.grade(testSuites)
.onVocareum()
.run();
}}
```Percolator also includes a number of [utilities](https://purduecsbridge.github.io/percolator/api/latest/edu/purdue/cs/percolator/util/package-summary.html) that make writing test cases easier. To see how we use these utilities in our test cases, take a look at our [lab examples](https://github.com/search?q=org%3Apurduecsbridge+example).
## Installation
Instructions on how to add Percolator to your Maven project can be found [here](https://github.com/purduecsbridge/percolator/packages/513132).## Contributing
Pull requests and new issues are always welcome.## License
Licensed under the [MIT License](LICENSE).