Developers validating an elections ballot-dropbox sensor parser cannot reach live hardware in the lab. How should they still unit-test the parse logic?
Select an answer to reveal the explanation.
Short Explanation
Use stubs or fixtures that feed sample sensor payloads so you can validate the parser offline. You shouldn't wait for stormy parking-lot visits to catch a broken parse.
Full Explanation
Developers validating an elections ballot-dropbox sensor parser often cannot reach live hardware in the lab. Unit testing still proceeds by isolating parse logic behind stubs or fixtures that feed sample sensor payloads offline. Those fixtures encode representative successes, malformed frames, and boundary values so assertions verify parsing without physical sensors or election-night risk. Shipping untested parser changes straight to election-night production bypasses validation when stakes and scrutiny are highest—an unacceptable practice for elections infrastructure. Only testing by standing in parking lots with physical sensors during storms is slow, weather-dependent, and poorly suited to rapid regression; hardware tests complement but do not replace offline unit tests. Disabling assertions permanently so every payload is accepted removes the safety net that catches parse defects and invalidates the purpose of testing. Exam caveat: keep fixtures realistic (field order, encoding, timestamps) and separate unit tests from rare hardware integration tests; never use live voter data in lab fixtures—synthesize payloads that match the protocol without exposing personal information. Operational check: run the unit suite with stubbed payloads in CI, fail the build on assertion errors, add a regression fixture for each production parse defect, and only then schedule limited hardware soak tests before elections windows.