Search code examples
javaoracle-databaseseleniumautomationfixtures

How to manage test data fixtures for acceptance testing in large projects?


Suppose we have large, complex system with large amount of data and complicated business logic.

How to manage test data (Oracle DB) to have fast, reliable acceptance (Selenium etc.) tests starting from known state?

Because of scale and complexity, tests should:

  • run quite fast (1. fast revert to known DB state before each test/suite 2. definatelly not creating test data by UI before each suite)
  • base on data created with UI (no direct INSERTS to database - risky duplication of business logic)
  • have several versions/snapshots of DB state (stable group of users with related data - to avoid conflicts between assertions and new data created with ongoing automation development)

Solution

  • What you're describing is called a Sandbox DB. For every new deploy you'll have to provide/populate this DB with the data you need and after tests are done, to drop it.

    have several versions/snapshots of DB state

    This is what a Fresh Fixture pattern and Prebuilt Fixture pattern will help you with. Also you could look at the Fixture Teardown patterns.

    Here you can find some considerations when dealing with such big-data-sandbox-strategies. Like scheduling, master data repository and monitoring.

    To successfully manage all that - a CI server have to be put to work. Since you've tagged JAVA, a good options are: