Test data management for Junit tests

We are faced with one problem when managing test data (xmls, which is used to create mock objects). The data we currently have developed over a long period of time. Every time we add a new functionality or test case, we add new data to test this functionality. Now the problem is when the business requirement changes the format (for example, the length or format of the variable) or any change that is not supported by the test data, we need to change all the test data, the size of which is 100 m. Can anyone suggest the best method or process to solve this problem? Any suggestion would be appreciated.

+5
source share
2 answers

Personally, I would stay away from creating test data in any other place, except in test cases. Instead of creating test data, create data generators that allow you to quickly generate objects in each test case or in each before the block.

This has two main advantages:

  • This makes reading tests easier because the developer can determine exactly which objects are being used, and
  • It should significantly reduce the amount of test data that you need to manage.

, , , DBDeploy . . DBDeploy DBUnit . , .

+7

, (, 100 ) - .

+3

All Articles