Each Wednesday our development team meets together to discuss a chapter in the book they’re reading and work through examples together. These meetings have really helped our team and culture grow as everyone has the chance to improve together.
This book inspired us to run automated integration tests prior to deployment (i.e., on a local server) to catch integration bugs before they even enter the test environment.
Integration Tests Before Deployment
Traditionally, this type of test could be run only after the database and API were deployed to the test environment. This means that API/database integration bugs would make it past the first cycle of development, necessitating an extra cycle for reporting and fixing the bugs. Now, since databases can be hosted locally in Docker containers, we can run integration tests on build servers (and even on our local machines) to catch bugs earlier and faster. .NET Core makes this easy by providing the TestServer class, which can host a test version of your web application with any configuration you choose (such as a Docker-hosted database, for example).
After learning about this capability from Hoffman’s book, we implemented locally-run integration tests for the most critical API calls in a user authentication microservice. On many occasions, these tests successfully caught integration bugs before they could be deployed to a test environment, resulting in faster fix times.