Skip to main content
Solved

Best practice for inserting mock data for you unit tests

  • July 26, 2022
  • 1 reply
  • 196 views

At this moment we are trying to implement unit testing in our process. However, we encounter several problems.

The biggest problem we encounter is preparing the mock data, because it’s very time consuming. Is there anyone who could explain me what would be best practice for inserting mock data in the Software Factory. What we experience is that it is difficult and not user friendly to insert data values into a data row. It costs us a lot of time to insert this data, and it is not very clear what foreign keys are of the table and the domains  of the values. So, all tips and best practices would be very helpful. 

 

Best answer by Anne Buit

Data entry and maintenance of large amounts of mock data can indeed be quite time consuming. The mock data screens are not designed with intensive data entry in mind. Generally, a few mocked records are enough to allow most unit tests to be built.

When it comes to data entry with foreign keys and domains - when inserting the mock data you do indeed not have the option to refer to other mock data as foreign keys ore to refer to domain elements to pick a database value. It could be technically feasible to allow selection of foreign keys or domain elements when entering mock data. Please submit an idea for this in the ideation section. 

In some scenarios, a large amount of mock data may be required. When working with such large mock data sets, it may be more efficient to set up a test database that contains the desired data and forgo setting up the mock data in the Software Factory. The test data can be entered and maintained by simply starting the application on the test database and will be included in data migration scripts when upgrading this test database to a new version.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

1 reply

Anne Buit
Community Manager
Forum|alt.badge.img+5
  • Community Manager
  • 637 replies
  • Answer
  • August 17, 2022

Data entry and maintenance of large amounts of mock data can indeed be quite time consuming. The mock data screens are not designed with intensive data entry in mind. Generally, a few mocked records are enough to allow most unit tests to be built.

When it comes to data entry with foreign keys and domains - when inserting the mock data you do indeed not have the option to refer to other mock data as foreign keys ore to refer to domain elements to pick a database value. It could be technically feasible to allow selection of foreign keys or domain elements when entering mock data. Please submit an idea for this in the ideation section. 

In some scenarios, a large amount of mock data may be required. When working with such large mock data sets, it may be more efficient to set up a test database that contains the desired data and forgo setting up the mock data in the Software Factory. The test data can be entered and maintained by simply starting the application on the test database and will be included in data migration scripts when upgrading this test database to a new version.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings