Coming up with a testing strategy
For applications such as MallBots, we should develop a testing strategy that tests whether the application code does what it is supposed to be doing. It should also check whether various components communicate and interact with each other correctly and that the application works as expected:
Figure 10.1 – Our testing strategy as a pyramid or ziggurat
Our testing strategy will have four parts:
- Unit tests
- Integration tests
- Contract tests
- End-to-end tests
Unit tests are a no-brainer addition to our strategy; we want to ensure the code we write does what we intend it to do. We want to test the input and output from the module core and include an integration test to test the dependencies that it uses. We will use contract tests to detect any breaking changes to the application’s many APIs and messages that tie the modules together. Finally, we want to run tests that check that the application...