Code Review Checklist - Java

1. Specification / Design [ ] Is the functionality described in the specification fully implemented by the code? [ ] Is there any excess functionality in the code but not described in the specification? 2. Initiali ation and Declarations [ ] !re all local and global "ariables initiali ed before use? [ ] !re "ariables and class members of the correct type and appropriate mode [ ] !re "ariables declared in the proper scope? [ ] Is a constructor called #hen a ne# ob$ect is desired? [ ] !re all needed import statements included? %. &ethod 'alls [ ] !re parameters presented in the correct order? [ ] !re parameters of the proper type for the method being called? [ ] Is the correct method being called( or should it be a different method #ith a similar name? [ ] !re method return "alues used properly? 'ast to the needed type? ). !rrays [ ] !re there any off*by*one errors in array indexing? [ ] 'an array indexes e"er go out*of*bounds? [ ] Is a constructor called #hen a ne# array item is desired? +. ,b$ect 'omparision [ ] !re all ob$ects -including Strings. compared #ith /e0uals/ and not /11/? 2. ,utput 3ormat [ ] !re there any spelling or grammatical errors in displayed output? [ ] Is the output formatted correctly in terms of line stepping and spacing? 4. 'omputation( 'omparisons and !ssignments

[ ] 'hec5 order of computation/e"aluation( operator precedence and parenthesising [ ] 'an the denominator of a di"ision e"er be ero? [ ] Is integer arithmetic( especially di"ision( e"er used inappropriately( causing unexpected truncation/rounding? [ ] 'hec5 each condition to be sure the proper relational and logical operators are used. [ ] If the test is an error*chec5( can the error condition actually be legitimate in some cases? [ ] Does the code rely on any implicit type con"ersions?

6ersion 1.7 © Copyright 2010 John Dalbey

t ha"e <dangling else= problems. 3iles [ ] !re all files properly declared and opened? [ ] !re all files closed properly( e"en in the case of an error? [ ] !re 9. 3lo# of 'ontrol [ ] In a s#itch statement is e"ery case terminated by brea5 or return? [ ] Do all s#itch statements ha"e a default branch? [ ] 'hec5 that nested if statements don.8. [ ] !re all loops correctly formed( #ith the appropriate initiali ation( increment and termination expressions? [ ] !re open*close parentheses and brace pairs properly situated and matched? 17. 9xceptions [ ] !re all rele"ant exceptions caught? [ ] Is the appropriate action ta5en for each catch bloc5? :.3 conditions detected and handled correctly? [ ] !re all file exceptions caught? 6ersion 1.7 © Copyright 2010 John Dalbey .

Sign up to vote on this title
UsefulNot useful