Ask HN: Testing Code Changes Against Production
I’m currently reaching out here to see if anybody has any advice on testing code prior to pushing to production. I write unit / integration tests to make sure code is as correct as possible, but I don’t have any way of actually testing it against real, production traffic to know for sure.
Writing a unit / integration test for every potential edge case doesn’t seem scalable - wondering if there’s a way to test code changes directly against production traffic without exposing users to potentially breaking changes?
A canary comes to mind but serving real production traffic would expose users to potentially breaking changes?
How do you guys handle this at your companies? Would appreciate any thoughts.
2 comments
[ 3.3 ms ] story [ 12.8 ms ] threadTest or staging would usually have a copy of old prod data.
It sounds as though you can’t predict the prod traffic though. Is there no sample traffic or even stats on types and volume of traffic over a period of time you can take to then feed to your test environment?