Giter Club home page Giter Club logo

percolator's Introduction

Percolator

build javadoc

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?

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.

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 using its builder methods, including adding a code style checker.

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 audits the Java source files in a given directory and enforces the rules defined in a Checkstyle configuration.

By default, the AutoGrader will assume you are using Gradescope. If you are using Vocareum instead, just use the onVocareum() method when constructing your AutoGrader.

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 that make writing test cases easier. To see how we use these utilities in our test cases, take a look at our lab examples.

Installation

Instructions on how to add Percolator to your Maven project can be found here.

Contributing

Pull requests and new issues are always welcome.

License

Licensed under the MIT License.

percolator's People

Contributors

reifiedbeans avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

reifiedbeans

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.