Running your code in the future →
I read this a while ago, but it’s worth a reread with the recent issues Twitter have been having relating to dates. Dates and time are inherently complex and they can behave in unexpected ways. Additionally, the state space of possible times the system could be in is massive. There are 32 million timestamps per year at a one second resolution; it would be nigh on impossible to do a full integration test on your code for every second of a year. Generative testing is one solution to testing a large state space, and is a great way of quickly testing a large number of cases. The linked article suggests a more primitive, but potentially more reliable option: run your tests continuously depending on the current time, but make your code think it is 90 days in the future. This would make your tests fail in CI and alert you 90 days before they hit production.