|
|
|
Ask HN: How do you test and develop time-dependent/flow-dependent applications?
|
|
3 points
by thomgo
1964 days ago
|
|
Hi all, I find myself running into difficulties when testing and developing for time-depdendent applications. What I mean by that is that certain actions in the flow of command result in states that depend on previous interactions. For example, how does Uber test their driver dispatch system, and corresponding notifications on the part of users when the driver is getting close to their pickup location? In here, the behavior of the application depends on the driver accepting a request, starting his ride, etc. I find it difficult to reproduce situations where the previous 'flow' affects the current state of the application and it's expected behavior. Hope I was able to explain my difficulties clearly. Thank you! |
|
In integration tests, we black box test our service from the edges. Docker Compose ftw. We validate logs and other output such as metric endpoints. If we read from a queue, we run that queue; same with all our dependencies. Sometimes we will use fake services with mock/default responses if running the dependency is too onerous.
System testing. We run a smaller clone of production as a staging environment. Automated tests kick off customer actions (say, using an API or submitting a file for processing) and monitors logs and sinks (customer webhooks, user notification, emails, files generated, etc). These test suites exercise the entire system from the customer point of view.
Production. Metrics, metrics, and logs (and alerts). Deployment dashboards of metrics and error logs, slo/sli graphs, and automatic rollback on some metric violations. We usually canary a single node, the do a multi-tier roll out.
When a bug shows up, we determine which level of testing makes the most sense and add a test case to prevent future regression. New alerts may be set up.