New answers tagged

0

For testing purposes take small steps. I think the best way is to prepare the scenario with the fake and small database instead of the real production database. You can copy some of the rows and as soon as you succeed then try for the real data.


0

I set up the appropriate data as part of the givens. That way the scenario is completely self-contained. Having a test database requires tacit knowledge (which customers are considered "active"?) or end up with data for obscure corner cases (I need a customer with two previous purchases and three items in their current basket.) And I agree with the other ...


2

You shouldn't have to have a production working database in order to run your tests. Also, querying and altering a production database when doing tests is generally a pretty bad idea. You want your tests to work in isolation. So, make a fake customer before your test. Use it. Delete it. If the creation is too complex, you could prepare a whole database for ...


2

The best practice is a third option. You create a separate test database with known contents and you write your tests against that. In between test cases, or in the set-up a test case, you make sure that this test database contains the known, well-defined data set, so that changes made in one test case don't affect the next test cases. I would never write ...



Top 50 recent answers are included