How should the tests that manipulate the database behave?

Asked

Viewed 22 times

0

In everyday life we come across scenarios in which we have snippets of code that are executed once during the entire life of the system. As an example:

  • Registration screen of the first administrator.
  • Initial system settings screen (installer).

These actions are usually done through middleware, which are executed in order to verify that there is no administrator or configuration in the database, thus allowing and redirecting the user to single-use screen.

Entering the area of automated testing, how could we test this kind of unique behavior?

Given that, in theory, tests should test all situations, we should also test this first access to the system, even if the system is already in production. But how this test should be carried out?

Considering that a test should deliver the database in the same state as the test execution, would the solution be to run the tests in a database other than the one actually used in the application? Using this practice would not be creating addicted tests'?

  • The title talks about database (I think), but when reading the whole question it seems that you are talking about graphical interface, for example the test act as human to test the behavior step-by-step, I think the question is a little confusing. Is just one constructive criticism to improve it and make it clearer, so you can get faster and better responses =)

  • @Guilhermenascimento thank you, but do not know the confusion, I cited examples of cases that the problem happens, that are to make these screens, in the paragraph below the question quote that these actions use the database to work, soon the focus returned to the bank.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.