Skip to content

Code review

Tools

  1. Static Analysis
  2. ESLint
  3. Prettier
  4. Automated Code Review
  5. Amazon CodeGuru
  6. Security
  7. DependaBot
  8. NPM Audit

Things to look for in code review

  1. Structure
  2. Logic
  3. Error Handling
  4. Proper use of HTTP method
  5. Performance
  6. Test Coverage
  7. Readability and Maintainability
  8. Check for proper infra such as Logging Systems, automated deployments etc

Important points to note

  1. Do not hurt the engineer's feelings. Everyone makes mistakes. Always provide constructive feedback
  2. A review should be a learning process, both for the reviewer and author. And must not be an ego-battle to prove that one is superior to other
  3. Code-reviews should be in chunks. This way, it is easier to go through the code properly and provide helpful feedback, vs reviewing the whole code-base at once.
  4. Every code piece should be peer-reviewed irrespective of who wrote it. Be it a senior developer or an intern.
  5. The aim should always be to develop a positive culture around code review. It should not be a process that scares people away. Instead, it should help engineers write better code, and work on the feedback received.
  6. Automate review process if applicable. Static Analyzers such as prettier and ESLint could reduce the time invested in the process by a lot.

Metrics

  1. Inspection rate: the speed with which a review is performed
  2. the number of bugs found per hour of review
  3. the average number of bugs found per line of code

Resources

  1. https://google.github.io/eng-practices/review/reviewer/