Testing Golang Spanner Interactions Using Test Doubles
Abstract—Almost all software systems require the use of databases for storing application data and state. As such, it is important to test the correctness of database operations made by various components of a system. A lack of testing can lead to bugs, errors and even outages in production. For systems using database services like Cloud Spanner, it is difficult to spawn a local database instance. This can make hermetic test setup quite difficult. To solve this problem, Spanner provides test doubles which can be used for unit and functional testing of database operations. These test doubles act like real Spanner servers but keep data in memory only and do not persist it. Although the performance and efficiency of these test doubles is quite low, they are well suited for hermetic correctness testing. In this paper, we review test doubles and the best practices associated with them. We then take a look at two test doubles offered by Spanner, with one of them being available only in Golang. We also cover the caveats associated with the use of these test doubles. Keywords—databases, software testing, test doubles, Cloud Spanner
Institutions
- Mountain View College (US)
- Mountain View Clinical Research (US)
Publication Details
- Journal
- INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT
- Published
- 2024-12-23
- DOI
- https://doi.org/10.55041/ijsrem10979
- Primary Topic
- Opinion Dynamics and Social Influence
- Type
- article
- Field-Weighted Citation Impact
- 0.00