Page 98 -
P. 98
Another benefit is that people who know that their code may be inspected tend to write
more maintainable software. It’s very common for programmers to not include comments
or to write very terse, confusing code when they know that they are the only people who
will ever read it. But if a programmer knows that someone else will be looking at it, he
may put a lot of effort into making it readable. This can have enormous savings in mainte-
nance efforts down the road.
Code Review Checklist
The following attributes should be verified during a code review:
Clarity
Is the code clear and easy to understand?
Did the programmer unnecessarily obfuscate any part of it?
Can the code be refactored to make it clearer?
Maintainability
Will other programmers be able to maintain this code?
Is it well commented and documented properly?
Accuracy
Does the code accomplish what it is meant to do?
If an algorithm is being implemented, is it implemented correctly?
Reliability and Robustness
Is the code fault-tolerant? Is it error-tolerant?
Will it handle abnormal conditions or malformed input?
Does it fail gracefully if it encounters an unexpected condition?
Security
Is the code vulnerable to unauthorized access, malicious use, or modification?
Scalability
Could the code be a bottleneck that prevents the system from growing to accommodate
increased load, data, users, or input?
Reusability
Could this code be reused in other applications?
Can it be made more general?
Efficiency
Does the code make efficient use of memory, CPU cycles, bandwidth, or other system
resources?
Can it be optimized?
90 CHAPTER FIVE