Code Review Report Sample
Code Review Report Sample
1
2
3
4
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Check code description
I - DEVIATION OBJECTIVE
# I.1 – DEVIATION
Does the code correctly implement the design?
Does the code implement more than the design?
Is every parameter of every method passing mechanism (value or reference) appropriate?
Does every method return the correct value at every method return point?
II – OMISSION OBJECTIVE
# II.1 –OMISSION
Does the code completely implement the design?
III - DEFECT OBJECTIVE
# III.1 – Variable and Constant Declaration
Are descriptive variable and constant names used in accord with naming conventions?
Is every variable correctly typed?
Is every variable properly initialized?
Are all for-loop control variables declared in the loop header?
Are there variables that should be constants?
Are there attributes that should be local variables?
Do all attributes have appropriate access modifiers (private, protected, public)?
# III.2 – Method Definition
Are descriptive method names used in accord with naming conventions?
Do all methods have appropriate access modifiers (private, protected, public)?
Is every method parameter value checked before being used?
# III.3 – Class Definition
Does each class have an appropriate constructor?
Do any subclasses have common members that should be in the superclass?
# III.4 – Data Reference
For every array reference: Is each subscript value within the defined bounds?
For every object or array reference: Is the value certain to be non-null?
# III.5 – Computation/Numeric
Are there any computations with mixed data types?
Is overflow or underflow possible during a computation?
Are parentheses used to avoid ambiguity?
Are divisors tested for zero or noise?
# III.6 – Comparison/Relational
For every boolean test: Is the correct condition checked?
Are the comparison operators correct?
Is each boolean expression correct?
Are there improper and unnoticed side-effects of a comparison?
Has an "&" inadvertently been interchanged with a "&&" or a "|" for a "||"?
Is every three-way branch (less,equal,greater) covered?
# III.7 – Control Flow
Will all loops terminate?
When there are multiple exits from a loop, is each exit necessary and handled properly?
Does each switch statement have a default case?
Are missing switch case break statements correct and marked with a comment?
Can any nested if statements be converted into a switch statement?
Are null bodied control structures correct and marked with braces or comments?
Does every method terminate?
Are all exceptions handled appropriately?
Do named break statements send control to the right place?
# III.8 – Input/Output
Have all files been opened before use?
Have all files been closed after use?
Is buffered data flushed?
Are files checked for existence before attempting to access them?
# III.9 – Module Interface
Are the number, order, types, and values of parameters in every method call in agreement with the called method's declaration
Do the values in units agree (e.g., inches versus yards)?
# III.10 – Comment
Does every method, class, and file have an appropriate header comment?
Does every attribute,variable or constant declaration have a comment?
Is the underlying behavior of each method and class expressed in plain language?
Is the header comment for each method and class consistent with the behavior of the method or class?
Are all comments consistent with the code?
Do the comments help in understanding the code?
Are there enough comments in the code?
Are there too many comments in the code?
# III.11 – Layout and Packing
Is a standard indentation and layout format used consistently?
For each method: Is it no more than about 60 lines long?
# III.12 – Storage Usage
Are arrays large enough?
# III.13 – Performance
Can the cost of recomputing a value be reduced by computing it once and storing the results?
Is every result that is computed and stored actually used?
Can a computation be moved outside a loop?
Are there tests within a loop that do not need to be done?
V – AMBIGUITY OBJECTIVE
# V.1 – Variable and Constant Declaration
Are there variables with confusingly similar names?
Are all variables properly defined with meaningful, consistent, and clear names?
VI – REDUNDANCE OBJECTIVE
# VI.1 – Variables
Are there any redundant or unused variables or attributes?
Could any non-local variables be made local?
# VI.2 – Method Definition
Are there any uncalled or unneeded methods?
# VI.3 – Performance
Can any code be replaced by calls to external reusable objects?
Are there any blocks of repeated code that could be condensed into a single method?
e called method's declaration?
Code Review Report
Project Code: [Project name] / [File name]
Version of the work product:
Reviewer(s): Nguyễn Văn A
Trần Thị B
Comment
variable: AVarThatNamedWeird
if (a & b)
var: the_x001D_Lists và theListss
Suggestion / Fix ?
aVarThatNamedWeird
if (a && b)
nên đổi theListss thành theGlobalLists