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 ...


0

If by "is it normal" you ask if it is common, no, it certainly isn't. A lot of dev teams have poor test practices (I belong to one) and even quality books I've read advice to spend roughly as much time coding the functionality than the tests. If by normal you ask if it is healthy, it depends, but two times more tests than needed is better than no test. It ...


1

There is the law of diminishing returns. Assuming you write tests for the riskiest code first, the value generated by further tests diminishes over time. Unit tests are code, so they will contain bugs (just like all other code). Fixing those bugs takes time. In my experience unit-tests contain far more bugs than the system they are testing, and fixing ...


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