Skip to content

Development Guidelines

Hanyuan Li edited this page Jun 15, 2022 · 2 revisions

Some guidelines for project development:

Developing

  • Follow the style guide for the language you're writing in - e.g. snake_case for function names in Python, camelCase in JavaScript.
  • Write comments! It not only helps when other people read your code, but when you read code that you wrote a while ago.

Git

  • Follow the commit format outlined in Conventional Commits, specifically the "commit message with scope" section. We should try and use feat:, fix: and merge to delineate different types of commits (and make our commit messages seem more readable), but the rest doesn't need to be followed super strictly.
  • Make a separate branch for each feature (e.g. for one page, for adding a specific feature, for adding a list of backend routes), and make sure all code in the main branch is bug-free.
  • Get at least one person to review your code before merging a pull request.

Testing

  • Do test-driven development (especially for backend), with testing as black-box as you can get.
  • Check the coverage of your tests!
  • Sometimes making tests completely black-box may be inconvenient (e.g. instead of adding a user directly into a database to test for repeating usernames, black-box testing dictates we have to access the register endpoint, which involves sending a verification email, checking for emails etc.), in which case the test doesn't have to be completely black-box.
Clone this wiki locally