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

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Testing Golang Spanner Interactions Using Test Doubles

INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT
Opinion Dynamics and Social Influence
article

Testing Golang Spanner Interactions Using Test Doubles

article en

Abstract

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

INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENTVol. 08(12)
Mountain View College (US), Mountain View Clinical Research (US)
Openalex Percentile: Top 77%
Opinion Dynamics and Social Influence
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Testing Golang Spanner Interactions Using Test Doubles · INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT (2024) | TGRS Research Map | TGRS