Code Review Template
Code Review Template
Version: Draft
Table of Contents
Scope ........................................................................................................................................................................................ 2
Purpose .............................................................................................................................................................................. 2
Implementation ................................................................................................................................................................... 2
Source Code ........................................................................................................................................................................... 2
Security ................................................................................................................................................................................... 2
Instructions for Code Preparation ................................................................................................................................ 5
Code Review Checklist: Modules (P. 1 Of 1) ............................................................................................................ 7
Purpose
Specific reason (new feature, bug fix, etc.)
Implementation
Source Code
Security
Required: Document Recommended changes may be prepared on a copy of the module, and
recommended presented for review.
changes to actual Both the original and the copy with differences clearly indicated
code should be provided.
PRESENT?
CATEGORY ITEM
Y, N, N/A
Module header The module must have a module header block containing:
File name:
Original creator:
Date created:
Person who last changed code (if different from creator)
Code revision number and change history (with dates).
NOTE: The name of each changed unit should be listed
NOTE: If a change is made to correct a defect, the number or
ID of the defect corrected should be entered as well.
High level description: (explain the module's purpose, and the
name/purpose of key data structures, variables, sub-functions
used, etc.)
Failure modes and effects analysis: List types of failures
which could occur in this module and result in a hazard to the
patient. List the types of mitigation actions the software takes to
prevent hazards from occurring. If these risks are documented
in a separate document, reference it. (Editor’s note: for non-
medical projects, the corollary would simply be an appropriate
analysis of possible software failure modes, and what the
software should do in each case.)
Function name
Change history: List of each change to the unit, with the date of the
change and the name of the person making the change. Reference
defect numbers or ID if the change was to correct a defect.
Purpose: A short description of the unit's purpose. The description
should be written such that the unit's purpose in fulfilling the
original software requirements in the SRS can be understood.
I/O description: A description of the inputs and outputs expected,
specifying their acceptable ranges.
Return value: A description of the return value
External variables: A description of any external variables used,
specifying acceptable ranges.
Unit design/algorithm: A more detailed description of the unit's
processing. Should be detailed enough that reviewers can
determine whether the code meets its design, but not so detailed
that the description is just pseudo-code.
Failure modes analysis: A list of possible failure modes resulting
in hazards or error conditions, and any mitigation actions this unit
is required to take (for example, range checking a data value before
use.)
PRESENT?
CATEGORY ITEM
Y, N, N/A
Code Checks
Descriptive comments are accurate and informative.
Return values (in particular error returns) are not ignored.
Constants and literals are not hard coded.
All variables used have obvious or descriptive names, and correct
scope.
Local functions and non-automatic variables are declared static.
System global functions have the module name as a prefix to the
unit name.
All functions have prototypes (compiler checks this).
Data structure fields are described and commented clearly.
Code is logically correct (Code performs intended functions,
operates correctly)
Numerical methods are sufficient
Accuracy of control outputs to external devices are within
tolerance
System I/O mechanisms are consistently used.
Standard module communication techniques are used (e.g. use of
message system)
Errors are detected and handled, and processing continued
Error handling conventions are followed (standard use of error
handling task, etc.)
Input values (or other data used) are checked for reasonableness
before use
Where necessary, critical output parameters or data are checked
for reasonableness during processing
Code pays attention to recovery from potential hardware faults
(e.g. arithmetic faults, power failure, clock).
Due Date -
Outstanding issues Assigned to
resolution
Sign-off date
NOTE: ATTACH CODE REVIEW CHECKLISTS (Module: 1 page. Each Unit: 2 pages)
NOTE: ATTACH CODE REVIEW CHECKLISTS (Module: 1 page. Each Unit: 2 pages)