Understanding database testing
In the world of testing, databases are often overlooked in literature. Most applications often assume in-memory data storage, just as we have done with the BookSwap
application so far. However, it is important to understand the difficulties and techniques that we have available when it comes to verifying our databases.
Databases are often seen as external systems or black boxes in our system. They provide specialized behavior and are often complex systems, which most often cannot fail. Figure 5.6 depicts the typical data translation between different formats:
Figure 5.7 – The data formats of a typical system
Data changes formats multiple times in a typical application. User requests usually enter our system in JSON format. The API layer area then translates these requests to the internal application models and sends them further down the stack to the Service layer area. Finally, the Service layer area persists these...