Summary
Integration testing focuses on the scope of controller methods or APIs exposed via your services to test the full stack of your code. It requires setting up the database, executing the code to be tested and querying the database. These tests are critical to ensuring all the components of your application deliver the expected behavior.
In order to make the individual code components, classes and methods as robust and future proof as possible, developers can test each method in isolation without incurring the overhead of setting up the database or updating it. As such, unit tests run more quickly. Unit tests can increase coverage, as more corner cases testing scenarios can be emulated using mocking of scenarios that would otherwise be impossible or difficult to setup on the database.
Unit Testing requires an understanding of some other patterns such as Dependency Injection and mocking. Dependency Injection can be implemented in a number of ways, using constructors, factories and setter...