Handling Code

Handling Code

⚠️
DRAFT

Architecture

You are expected to implement and adhere to an architecture that was presented in-class - MVVM, MVI or Clean. Note that MVC is not sufficient for full marks! See the instructor if this is unclear.

Document

  • Choice of architectural style
  • Choice of design patterns (make sure this lecture is in place first!)

Authoring code

Code Comments

When writing code, you should add strategic code comments to explain the purpose of your code (not “what it does”, but “why is it done this way”). This does not need to be exhaustive, but it’s a good practice for complex and/or critical code.

Unit Testing

You must practice Test-Driven Development, and write comprehensive unit tests to follow your source code. You should be producing unit tests at each phase of your project (do NOT attempt to write them all at the end). This will be discussed in-class - see slides.

Revision control

Code commits

You are expected to regularly commit your code to git.

It’s a good practice to write your code incrementally:

  1. Write a unit test for the code you are going to write. This helps define your interfaces.
  2. Write code to achieve what you wanted and which also makes your test pass.
  3. Add more tests to cover a reasonable number of inputs.
  4. Commit to git!
  5. Iterate.

Your Git commit history should reflect the work that you did during the sprint, and a TA should easily be able to see what commit belongs to which issue. A good practice is to put your issue number in the commit message to make it easy to find later!

Feature branches

For large features, you should be using Git feature branches and merging code back to main after each feature is complete.

⚠️
Do NOT squash commits or rebase in this course. We need to see your complete commit history to assign a participation grade!