Control your test data.

Don’t let it control you.

When you’re using data in your tests, you should avoid using data that is a copy of production. Sure, it may seem like a good idea, as it will more closely simulate the production environment. The problem, however, is that the production data may change. At that point, the tests will no longer be simulating production. They may, in fact, represent things that are no longer true.

Instead, you should use test data that you can completely control. The test data should support the business rules and examples. It should cover all of the edge cases and special circumstances dictated by the business rules. Most important, it should not depend on what any particular customer has for data, as that can always change.

Also, data in test cases should be fully defined and not generated randomly. Random data will cause tests to fail randomly, which will make the developer’s job very difficult and frustrating.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: