0

How to manage test data in e2e test at Facebook or Amazon?

Profile picture
Engineering Manager at Sinch2 years ago

Say i want to automate an e2e test for a complex user journey of my web application, i assume that test should automate on a running system and interact with the system like real user (so, no mocking whatever).

How do we create and manage test data? Should automate the creation of test data as well? or ? Please advise.

Can you give an example for this case: a user buying a product, goes through the checkout process with real payment using Paypal?

86
2

Discussion

(2 comments)
  • 0
    Profile picture
    Tech Lead/Manager at Meta, Pinterest, Kosei
    2 years ago

    There is no separate test database for Facebook. There is a notion of a test users, but AFAIK, the test users are actually just interacting with prod data. There is a pretty robust internal tool to manage test users, have them be friends with each other, and configure them appropriately (e.g. have them be located in a certain country, have a specific gender, etc).

    At least for mobile, I'm pretty sure that for the vast majority of the life of the mobile apps, there were very few mobile apps. Testing has become much more important recently, and I believe there are some internal frameworks to allow e2e testing as part of the CI system, but these things are in constant evolution.

    If you're trying to learn, I'd look at engineering blogs that talk about testing. If a company writes a blog post about it, they have a well-defined (and stable) enough system that it's worth learning from.

    Stripe has a very robust test framework (as you'd expect for a company where the core value proposition is billing + checkout!). I'd highly recommend looking at their system of fixtures to mock a series of API requests and force the mocked API to return the same data each time.

  • 0
    Profile picture
    Tech Lead @ Robinhood, Meta, Course Hero
    2 years ago

    I'm generally not a fan of end-to-end tests, which I cover in depth here: "What's the best way to carry out an end-to-end (E2E) testing effort?"

    At Meta, we had a very intricate ecosystem around making test accounts. As Rahul mentioned, we made everything as close to the real experience as possible by using actual production data - There is no separate dev database. It was a fun experience going through my Instagram as I would see test posts and stories from my teammates on their test accounts.

    Zooming out though, I recommend figuring out what your needs are and working backwards from that to figure out a company to model after. If you're doing e-commerce, mirroring Meta doesn't really make sense. On top of Amazon, it probably makes more sense to learn from Stripe, Block, and eBay instead.

Sinch, formerly CLX Communications, is a telecommunications and cloud communications platform as a service (PaaS) company. Headquartered in Stockholm, Sweden, Sinch also has offices in over 30 cities worldwide across multiple continents.
Sinch3 questions