News for hackers. Stuff that matters.
Re:Mocking Is an Anti-Pattern by Hendrikto on Monday June 17, 2024 @11:56AM (#40706998)
At several places I worked at, we would snapshot the production DB, and use that for testing. You cannot get more ”real-world“ than that. We would also record real requests, and replay them (optionally at increased speed) for load testing.

Obviously, there are some caveats, e.g.:

* While this approach works perfectly for some tests (load testing, performance testing, …), it does not work for others (e.g. unit testing).

* You have to be careful about PII, and sanitize your data.

There are no comments on this comment yet.