25 May 2019

Software project basics

History / Edit / PDF / EPUB / BIB / 1 min read (~112 words)
  • Code changes are stored in git
  • Setup continuous integration
  • Have a testing framework
  • Use dependency management
  • Define a code standard
  • Prefer function/method typing over dynamic types
  • On every push to git
    • Code quality check
    • Code style check
    • Unit/functional/integration/system tests
      • Code coverage should be recorded during tests and a report made available
  • A project repository must have a README.md explaining how to run the project on your own computer
  • A project repository must have a RELEASING.md explaining how to release the code
  • Responsibilities are made explicit in terms of roles
  • Critical roles, such as project lead, must have a backup/shadow individual
  • Setup telemetry, alerts, profiling, logging
25 May 2019

Writing tests

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

When joining a new project without tests, here is the value you need to provide through the addition of tests:

  1. the application works and doesn't crash
  2. the application works and supports a few input cases
  3. the application works and supports a variety of input cases
  4. the application works and is robust to most input cases
  • 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
25 May 2019

Writing commits

History / Edit / PDF / EPUB / BIB / 1 min read (~85 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

25 May 2019

Writing code

History / Edit / PDF / EPUB / BIB / 1 min read (~59 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
29 Dec 2018

Starcraft

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

Authentication/Login server
Per game server

  • compute damage simulation
  • in game chat
  • decide game victory
  • returns end game stats for ui (or done client side?)
    Game client
  • display game ui
  • play animations
  • send commands to game server
    Local backend
  • record game
  • compute game simulation
  • communicate game state to game client