How do you test your API?
Testing software is not a trivial task. It requires a good understanding of the code intentions, an understanding of some theory around testing, and the skills to set the system up for testing. That is why building your test in parallel to your application is essential:
- First, the code’s intentions are fresh and clear in your mind
- Second, you design the code to be testable
- Third, you can be sure that everything is working as expected before moving on, which reduces the mental burden of the project and the accidental introduction of bugs in thast code in the future
But how do you test your API? There are three main kinds of tests that are well known and recognized by software developers:
- Unit tests
- Integration tests
- E2E tests
Let’s explore each one in detail, starting with unit tests.
Unit tests
Unit tests are tests that only test one specific thing at a time; for example...