Skip to content

API Code Review Checklist

Sumesh Punakkal Kariyil edited this page Apr 23, 2019 · 8 revisions
  • Common

    • Proper naming conventions followed on variables, classes, definitions etc.

Module names should be lowercase with underscores instead of spaces. (And should be valid module names for importing.)

Variable names and function/method names should also be lowercase with underscores to separate words.

Class names should be CamelCase (uppercase letter to start with, words run together, each starting with an uppercase letter).

Module constants should be all uppercase.

  • Proper logging levels are used in the code
  • REST

    • Endpoints follows agreed pattern and organized around resources
    • Conform to http semantics
    • Proper filtering and pagination is provided for large amounts of data
  • Code structure

    • Resources is used for request payload processing, validations, response codes, messages etc.
    • Service is used for business logic, 3rd party communication management. Maintains proper folder structure.
    • Model is used for database models.
    • Schemas is used for json schema
    • Util contains commonly used utility functions, constants
  • Test Cases

    • Unit test cases with happy and sad path for service, model (?) layers
    • Endpoints test cases with happy and sad path for resources
    • Mocking of services (mainly 3rd party dependencies) provided if applicable
    • Postman collection tests provided for endpoints with happy path
  • Code Quality

    • Proper code coverage for all the layers (percentage 80, 90 ?)
    • Linting
  • DB Migrations

    • Alembic is used to manage database migration. Reference
Clone this wiki locally