Lab Grading Criteria
As with homework assignments, lab grading will be based partially on
completeness and partially on correctness/quality. Only a subset of lab code
and lab reports will be graded for correctness/quality. The following criteria
specify how points will be awarded when correctness/quality is being assessed.
Correctness: A measure of how well your program satisfies the requirements of the assignment.
This score will depend primarily on the performance of your program when run against a set of instructor JUnit test cases. For some assignments, it will also be necessary for the instructor to include manual test cases such as:
- Checking that your code meets the specifications in the assignment (e.g. specific class names and method signatures).
- Executing your program manually and checking that it performs all required operations correctly (if not fully tested by the instructor JUnit reference tests, e.g. GUI programs).
- Inspecting your source code for bugs not easily uncovered by automated testing methods.
Code Quality: A measure of the style and efficiency of your program code.
This will include factors such as:
- Formatting:
- Use of spacing and indentation to make code more readable.
- Following Java convention for variableNames, methodNames, STATIC_VARIABLES, etc.
- Documentation & Readability:
- Choice of descriptive class/method/variable/parameter names, etc.
- Including Javadoc comments, with appropriate tags (e.g. @param, @return) on classes, constructors and methods.
- Appropriate use of explanatory block and line comments within code.
- Statement choice:
- Appropriate statements are selected that enhance the semantic content of the code: use of for vs. while, nested vs cascading if/else, appropriate use of Boolean operators in conditions, etc.
- Efficiency:
- Code does not perform unnecessary work or use unnecessary memory: no extraneous fields/variables/code, appropriate data type selections, proper use of static modifier, use of fields vs. local variables, etc.
- Maintainability:
- Appropriate use of techniques to enhance reusability and maintainability of code: class constants, private helper methods, proper access modifiers, etc.
Test Quality: A measure of how thoroughly you have tested your own code.
For labs that require JUnit tests, this score will be based on an examination of your submitted JUnit tests. The highest scores will require:
- That your code is tested thoroughly (all code is exercised, likely sources of errors are probed, boundary cases are tested, etc)
- Each test checks a specific functionality and the purpose of each test is readily identifiable from the test method name and/or added comments.
- Each test includes appropriate assertions with helpful failure messages.