Why Make Unit Tests?

Unit testing is a big part of the WARG Firmware experience. As a part of our team, you will have to write unit tests for almost any higher-level module you create/modify. All unit tests you write will be merged in with your code when you make a PR to ZeroPilot-SW.

Now, you may be wondering, why do we care so much about unit testing on WARG? We have two main reasons:

  1. Unit tests prove that your code works:

    1. There are situations where you have written code that you think works, but in practice doesn’t. Unit tests are an objective way of verifying that the code you have written actually works, giving us peace of mind.

  2. Integration Testing:

    1. When you modify code in ZeroPilot, you may touch code in multiple modules. Sometimes, while doing this, you may make a mistake that causes the existing code to fail. If we did not write tests, there is a chance you (and your reviewers) won’t notice that the existing code has stopped working, resulting in broken code being merged into ZeroPilot.

    2. By keeping all our unit tests on GitHub (and letting everyone run them on their local), we are more aware if new edits break existing code.

Testing is actually a big part of all successful development teams. There are many other tests in addition to unit tests that one can perform. If you would like to look more into the different types of tests performed in industry, you can start with this link!