They improve test realism but slow down execution.
Using real databases in integration tests provides a realistic environment, which helps catch mapping and syntax errors that might not surface with mock objects. However, they can slow down test execution, particularly in CI/CD pipelines, due to the overhead of starting and managing database instances. In a high-traffic e-commerce app, this trade-off requires careful consideration to balance speed and accuracy.
Additional Notes
What are the trade-offs of using real databases in integration tests?