Program Grading Criteria - An Overview
COMP 14
(Borrowed from Kye Hedlund)
An 'A' program:
1. Correctness
-
Is Correct - will produce the required output.
-
Is Complete - will produce correct output on all legal inputs.
-
Will properly handle illegal inputs from the user whenever feasible (but
note that it is not possible to catch everything that may go wrongg).
-
Is robust. It will not "blow up" under any circumstances (e.g. divide by
0)
2. Style
-
Is Concise. The algorithm and code are efficient. There are no unnecessary
calculations and no repetitive code.
-
Is Clear. The structure of the solution is apparent from the code:
-
The presentation of code on the page reflects its structure.
-
The author has used blank lines, indentation and vertical alignment to
show program organization.
-
Meaningful identifiers are used.
-
Named constants are used. No magic numbers.
-
Uses comments to explain both the overall logic of the program and its
details:
-
The algorithm used is clear from reading just the comments of the program
(with no need to read the code).
-
Block comments introduce each major section: the program itself, each subroutine
and each long block of executable code.
-
Line comments explain all variables and constants plus many details of
how the code works.
-
In sum, the reader understands what the code is doing and how it does it.
3. Input / Output
-
Prints output that is understandable without having to understand the program.
Clearly labels all output.
-
Prints a banner at the start and end of the program.
-
Prompts the user for all input listing the options wherever feasible (e.g.
"Enter next temperature followed by a carriage return (-9999 to stop):
").
-
Echoes all input.
A 'C' program:
1. Correctness
-
Produces correct output on some but perhaps not all legal inputs.
-
Does not handle many illegal inputs.
-
Is not fully robust. Some inputs may "blow up" the program.
2. Style
-
Is in pretty good shape, but there may be unnecessary or unneeded sections
of code that the user has not bothered to remove.
-
Has code that only partially shows the structure of the solution.
-
The program has some portions that the reader finds mysterious and unexplained.
-
The reader must work to figure out what is going on in the program.
-
Has comments that do not entirely explain the algorithm. There are gaps
and omissions.
-
In sum, many portions of the program are well commented and clear, grade
'A' work, but others are not.
3. I/O
-
Prints output that is not clear simply from reading the output. A reader
has to know what the program is doing to understand its output.
-
Prints banners, but they are not self explanatory.
-
Prompts user for input, but her options are not explicitly spelled out
for her (e.g. "Next input: ").
-
Does not echo all inputs.
An 'F' program has one or more of the following:
-
Has major execution time errors. It may not run at all.
-
Has few if any comments to help the reader understand what the program
does. Actually, the author may not understand what it does.
-
The logic of the program is a mess, spaghetti code. It is obvious that
the program has been revised over and over in the vain hope that it will
eventually start working on its own, but the author has made no attempt
to clean it up and take out the portions of the code no longer in use.
-
The reader has little idea what the code does or how it does it.
-
Note that it is possible to get a perfect score on correctness grading
but still get an F due to poor style.