Development test problem

Can I ask some help, how do you all maintain the data in database during development project. we have production database and development database. the problem is that one web developer is developing invoice , the other developer is adding module in project other developer task is working in generation of pdf invoice. and each developer has it’s own v.m and database. during testing our tester is having difficulties in testing because his database is not same in the developers database. if the tester will copy the database from the developer it takes time . can someone please share how you test your project without having problem of the test data or do how do you sync your live data to development ?.

Part of the test cycle would be for the tester to develop the set of database entries that should exist for their tests to function.

A test cycle should start by the database being empty; the test data being loaded, and then the tests run. If the test fails, then the developer and tester should get together and find out why. (Is the tester’s test data wrong? Is the developer’s code not handling the test data correctly?)

Thank you for quick reply, I think empty database for the tester is difficult on his end what if he need customers records the charges records the orders records. what if he test the generation of invoice.

Then he should generate a fake order, (potentially) with fake items. That way when he tests the generation of an invoice, he can write into his test code “The value of the order should equal 12.34$” and not have to try and figure out what a customer’s total should have been on-the-fly.

Testers should not be working with live data for the purposes of testing functionality - a test should be a controlled environment.

2 Likes

You do not specify whether you are asking about unit testing or system testing. I think the solution would be different for each of the two levels.

Sounds to me what you’re looking for are database migrations, along with data fixtures.

There are several tools for database migrations, and it depends on the language you’re using which one would fit your stack. At work we use sqitch which works awesome for our usecase.

The idea behind is that just like with your code, your database has versions as well, and you can write files that define how to go from one version to the next.

Database fixtures are known sets of data that you can insert into the database using some tooling from your language. For example you could create an admin user, a custom, a few invoices, etc.

Combining both, when the user wants to test something they can use the database migrations to restore the table structure to a known state and then use fixtures to insert some known information.

1 Like

What app language are you using.