Pergunta

This question is kind of general and not very specific. We have a java project that uses Oracle database. We are currently using SoapUI tool for the QA tests. Each test needs some data to exist on the database before it is run. Our current way of running the tests is as follows:

  1. Before each test we run a .sql file (unique to the test) to load some data into the db
  2. We run the soapui test
  3. We use a general .sql file to erase the test data we inserted for the test
  4. Go back to 1 and run the next test.

The advantage of this method for us is that each test runs on a "clean sheet" with it's own data and is unrelated to the other tests.

The disadvantage is that each time during development when something changes in the db, for example a column was added to a table, we need to change all of the sql scripts that inserts to this table instead of changing in one place, this makes it very hard to maintain the tests.

I wanted to know what are some of the industry "standards" ways of doing this kind of stuff, or to hear more approaches to solving this problem.

Any advice would be great.

Foi útil?

Solução

You could integrate a SQL data generator into your testing loop. A suitable data generator takes the schema and additional constraints as input and produces data that is consistent with the current schema.

This way, every time the schema changes, the changes are accommodated by the test generator. You can have your test specific SQL scripts modified to be input constraints for the data generator. The link is to another question on SO where relevant tools have been listed.

Outras dicas

You can include Databene Generator in your toolchain. It can generate sql files or talk directly to database. You have just create xml file with data generation scheme.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top