What Is a Useful Regression Test for a Sensor Replacement?
From the earlier reference collection. Read the current software blog.
Compare station identity and relevant metadata across a documented sensor change so continuity is not assumed from a reused display name.
Capture identity before the change
A sensor replacement can create a subtle break in a time series. The station label may stay the same while the measuring instrument, location, or calibration context changes. Build a regression fixture from documented before-and-after records that includes stable identifiers and the metadata needed to distinguish the observations.
Record what the data source says about station ID, sensor or instrument ID when available, coordinates or location description, measured variable, and effective dates. Do not infer that every field must change: the test should reflect the documented replacement and the system’s identity rules.
Compare meaning as well as strings
Assert that the replacement is represented according to the product’s continuity policy. If the station identity remains stable but a sensor identifier changes, the data model may need to preserve both periods while making the equipment transition discoverable. If the location itself changed materially, silently joining the readings could create a misleading continuous series.
Use explicit expected metadata rather than comparing only display names. A station called “North Pier” in both snapshots does not establish that the same physical point or instrument produced the values. Include the effective date so queries can associate each observation with the correct period.
Test downstream behavior
Exercise the path that selects or presents historical readings. Verify that the old and new records are either joined or separated as intended, and that any replacement note or discontinuity marker appears where users need it. A parser-level comparison can pass while a dashboard still merges the periods without context.
A useful boundary assertion checks the last observation before the change and the first after it. Confirm that each maps to the expected metadata record and that a query spanning the transition does not assign the new instrument identity to earlier data.
Keep the fixture auditable
Store the source record or a concise transcription of relevant fields with its provenance in the test fixture. Name the case after the documented transition, not after an assumption such as “same station.” If the source later corrects metadata, review the expected continuity policy before updating the test.
This regression check protects interpretation as much as parsing. It verifies that a sensor replacement remains visible in the data model and that historical comparisons do not imply more continuity than the metadata supports.