Homework Grading

Components of Homework Grades

Correctness Component

Homework assignments are submitted on gradescope. For each assignment, gradescope will run a set of automated tests that test the correctness of your implementation. These tests are worth 85% of the base grade.

Testing Component

As you progress as a programmer, I’d like you develop skills to:

  • Debug your code, which requires writing test cases that you run locally on your computer
  • Write comprehensive test cases that test different branches of your code

To encourage this, part of your grade for some homework assignments will be determined based on whether you submit comprehensive test cases on gradescope. I will give specific instructions about what I expect to be tested in your test cases for each assignment; you can always go above and beyond and write even more comprehensive test cases!

I will give you a set of \(n\) requirements for your test cases. For an assignment that meets \(m\) of those requirements, you will earn \(\frac{m}{n}\) of the test points (15% of the base grade).

Style and Documentation

The final component for each homework that may be graded is style and documentation. Part of the grading is automatic using checkstyle with the Google Java Style Guide. Your grade will go down by 1% per rule that is broken in the style guide, up to a maximum of 10%. Up to two broken rules will be ignored, and multiple errors that break the same rule will be reported but will not count against your grade.

I will also conduct a manual review for style, with a particular focus on design. Up to 5% may be deducted based on this manual review.

Solutions that Overfit Test Cases

I reserve the right to not award credit if your solution overfits the test cases for any assignment. Imagine the following solution to a homework assignment that asks you to write a method isEven that returns true if a number is even and false if a number is odd:

class NumberChecker {
    public static boolean isEven(int number) {
        if (number == 0 || number == 2 || number == 40 || number == 124) {
            return true;
        } else {
            return false;
        }
    }
}

This solution clearly works for some numbers, but is not an attempt at writing code to solve the general problem. If the autograder tests numbers 0, 7, 2, 91, 40, 53, and 124, you would pass all of the tests, but would probably only be able to do so by resubmitting to the autograder until you figure out what all of the test cases are. Therefore, you would be overfitting the test cases and not attempting to solve the more general problem, and would not be awarded credit.

If you submit a solution like this and do not receive credit, you may resubmit following the homework resubmission policy. If you have questions about whether or not your are overfitting to the test cases, I’m happy to chat with you (you should know if this is something that you are doing).