Testing is a very broad subject, and it deserves a lot more space than we can devote to it in this book. Here, we will merely be able to scratch the surface.
Introducing testing
Code quality and testing
The population service of WorldExplorer might be coded defensively, but we should have proof that it will fail gracefully when issues arise.
Here are some examples of things that could go wrong:
- The network could be down when we make a request or before we receive a result.
- The server might be unavailable.
- The server might return unexpected data (for example, missing data, incorrect types, HTTP errors, and many others).
- The code making use of the service could provide invalid input (for example, for the dateRange...