Skip to content

Instantly share code, notes, and snippets.

@lukeasrodgers
Last active December 21, 2021 14:10
Show Gist options
  • Save lukeasrodgers/33a3b98e6cef4805c0040d29fb17de81 to your computer and use it in GitHub Desktop.
Save lukeasrodgers/33a3b98e6cef4805c0040d29fb17de81 to your computer and use it in GitHub Desktop.
code review

config

  • ensure config is loaded/tested in correct env

arithmetic/math

  • check for divide by zero
  • is integer division/rounding accounted for?
  • what happens if inputs are very small/very large? or negative?
  • what happens if results are negative (even though this "should never happen")
  • integer overlow (in languages where matters)
  • catastrohpic cancellation and other floating point concerns

db

  • is a transaction necessary? can races be handled without a transaction?

background jobs

  • can it be idempotent?
  • do other jobs depend on this completing in a certain amount of time, or order?
  • if we change this job, will already-enqueued things fail because they're expecting different params?

general

  • make assumptions explicit -- what happens when things that should never happen happen?

strings

  • handling unicode correctly?
  • is db column large enough to store it?
  • can it fit into UI?
  • do you need to strip whitespace?

naming

  • possible collision with language or framework, e.g. type columns could conflict with rails

HTTP endpoints

  • are params sanitized?
  • will params be shown to a user ever?
  • what if we receive two simultaneous requests from the same user?

data from the API

  • validate it as it enters the system?
  • if we are storing it, how often will it need to be refreshed?
  • rate limiting
  • errors and retrying
  • tracking failures

time

  • can it happen in the past? should it happen in the past?

remote API requests

  • will we hit a rate limit?
  • what happens if the request succeeds but we never get a response due to network error?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment