7. Testing
For testing, we rely on a combination of manual testing, unit tests and system tests.
Manual Testing
In manual testing, we start the backend locally or on an AWS stage and test the backend manually using an API client such as Insomnia or Postman.
System Tests and Unit Testing
We rely on unit tests for frequently used algorithms and functions.
We use system tests to test the complete endpoints. These briefly start the backend for each test. The endpoints can then be accessed directly in the test. Once the test is complete, the backend is stopped again, the database is reset and the next test is started. This has the advantage that the tests are independent of each other and do not influence each other.
We use fixtures to keep the tests lean. These are carried out before the test is executed and prepare the backend accordingly (e.g. create admin, create user, …)
The VsCode Task Test Explorer can be used to start both tests. This can be opened at the test tube icon.
The code for the end points must be generated before execution. The VsCode Task “Gen: Generate Entry Points (Gin)” can be used for the creation.