草 稿

Code Review Checklist

Source Link: http://blog.fogcreek.com/increase-defect-detection-with-our-code-review-checklist-example/

  1. General

  2. Does the code work? Does it perform its intended function, the logic is correct etc.

  3. Is all the code easily understood?

  4. Does it conform to your agreed coding conventions? These will usually cover location of braces, variable and function names, lin

  5. Is there any redundant or duplicate code?

  6. Is the code as modular as possible?

  7. Can any global variables be replaced?

  8. Is there any commented out code?

  9. Do loops have a set length and correct termination conditions?

  10. Can any of the code be replaced with library functions?

  11. Can any logging or debugging code be removed?

  12. Security

  13. Are all data inputs checked (for the correct type, length, format, and range) and encoded?

  14. Where third-party utilities are used, are returning errors being caught?

  15. Are output values checked and encoded?

  16. Are invalid parameter values handled?

  17. Documentation

  18. Do comments exist and describe the intent of the code?

  19. Are all functions commented?

  20. Is any unusual behavior or edge-case handling described?

  21. Is the use and function of third-party libraries documented?

  22. Are data structures and units of measurement explained?

  23. Is there any incomplete code? If so, should it be removed or flagged with a suitable marker like ‘TODO’?

  24. Testing

  25. Is the code testable? i.e. don’t add too many or hide dependencies, unable to initialize objects, test frameworks can use method

  26. Do tests exist and are they comprehensive? i.e. has at least your agreed on code coverage.

  27. Do unit tests actually test that the code is performing the intended functionality?

  28. Are arrays checked for ‘out-of-bound’ errors?

  29. Could any test code be replaced with the use of an existing API?

率先点赞

评论(0