24 May 2019

Writing code

History / Edit / PDF / EPUB / BIB / 1 min read (~81 words)
  • Make sure you understand what you have to implement
  • Make it work
  • Write a test for what you implemented
  • Refactor the code for reusability/code standard
  • Verify that your code passes linting and tests
  • Commit your code on a branch
  • Push to the central repository
  • Verify that CI passes
  • Create pull request
  • Annotate code to explain intent of changes
24 May 2019

Web applications

History / Edit / PDF / EPUB / BIB / 1 min read (~156 words)

  • 3 different environments: development, staging, production
  • Write migrations for schema changes
  • Use ORM if possible over raw queries
  • Always make it possible for testers to report the version they tested against
    • Simplest is to have a meta field in the head section

  • Mockups
  • SRS
  • Database and software architecture
  • Implementation
  • Test/QA
  • Deployment

24 May 2019

Reviewing code

History / Edit / PDF / EPUB / BIB / 2 min read (~337 words)
  • Verify that the build/tests pass
  • Understand the feature and associated requirements that are supposed to be implemented
  • Check code implements the desired feature and that the requirements are completed
  • Check code contains tests
    • Is all the new code covered by those tests?
  • Verify the location of new files
    • Are the files in the right directory?
    • Are they appropriately named?
  • Verify classes, methods, functions, parameters naming
    • Are they significant of their purpose?
    • Are they clear enough?
    • Are they respecting the naming convention?
  • Does the code respect SOLID?
  • Consider that when functions/methods signature change, code may now be backward incompatible.
    • Discuss whether this is necessary
    • Backward incompatible changes should be documented
  • Are there TODOs that should be completed within this review?
  • Check code for code style issues

24 May 2019

Writing tests

History / Edit / PDF / EPUB / BIB / 1 min read (~37 words)
  • Write a test that tests the common case usage of your function
  • Write tests that cover edge cases of your function
  • Write tests to cover all statements, branches, paths
24 May 2019

Writing commits

History / Edit / PDF / EPUB / BIB / 1 min read (~168 words)
  • One liner describing what changed (not period terminated)
  • A few lines describing in more details why things changed
  • GPG signed commit

  • Separate subject from body with a blank line
  • Limit the subject line to 50 characters
  • Capitalize the subject line
  • Do not end the subject line with a period
  • Use the imperative mood in the subject line
  • Wrap the body at 72 characters
  • Use the body to explain what and why vs. how