Pre-Deployment Checklist for Developers

  1. Handled all error conditions?
    Have you checked each error and handled or propagated upstream?

  2. Returned appropriate error code
    Please return proper error code & detailed error message to callers.

    msg := fmt.Printf("[fname] failed in Redis Set err=%s ret=%d", err, ret)
    ret errRedis
    
  3. Added logs for each failure
    It will help you narrow down the trouble code.

  4. Successful build with lint
    lint keeps your code clean.

  5. Formatting fixes (gofmt)
    Always follow the coding standard of the language, especially symbol names.

  6. Code reviews by at least two people.

  7. Unit Testing (docker compose)
    UT is easy and catches stupid bugs. There are many ways to test the code. The easiest is just the functions you’ve added. Stub any call you don’t or can’t test.

  8. Scale testing (for finding a resource such as sockets, memory leaks)
    UT is ineffective catching serial and slow bugs. These are the most troublesome problems that can be caught using heavy load & volume testing

  9. Staging deployment

  10. Finally, live on production 🙂

Advertisements