Work

Testing Golang Spanner Interactions Using Test Doubles

Year: 2024
Type: article
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
Authors: Mountain View, USA, Nilesh Jagnik
Language: English
Subfield: Software
Open Access status: bronze
OpenAlex ID: W4405729101
FWCI:
Cites:
Cited by:
Related to: 10