Visual Studio supports the performance testing of varies applications through different types of tests like Web Test, Load Test, etc. It also support the data generation for the performance testing. Data Generation Plan helps us to populate the database with bulk amount of test data.
You can refer the following articles for Web performance Test and Load Test.
Web Performance Test Using Visual Studio- Part I
Web Performance Test Using Visual Studio - Part II
Data Generation Plan
When the data volume increases, most of the applications fail to perform better. Increase in data volume may cause deadlock scenarios or performance degradation. Volume testing before release to production will reveal these kind of performance issues. In development or test environment, we may test the application using hundreds of rows of data. But in production environment, the data volume may be very high. With the lack of enough data volume in test environment, the performance issues may propagate to production environment.
Visual studio has the data generation plan feature which can be used to populate the database with required amount of test data for volume testing. Using the data generation plan, we can perform a very good performance testing and can avoid many of the performance issues. In this article we will discuss about how to generate data for our volume testing using Data Generation Plan.
1. Create SQL Server Porject
Create the SQL Server project using specified project template. Here, I selected SQL Server 2008 Database Project template for our sample application.
2. Import Database
Once the project is ready, import the database objects and settings to the project. This will connect our database with the SQL project.
Right click on the project and select the option “Import Database Objects and Settings”
This will open the Import Database Wizard. Specify the database connection or create a new connection to the database. Click Start.
Once the database schema import completes, select Finish.
3. Add Data Generation Plan
Now, add a new Data Generation Plan using the Context menu.
Right click on the Data Generation Plan folder and select Add-> Data Generation Plan.
Select the Data Generation Plan item template.
4. Select Tables
Once, the data generation plan added to the project, it opens the file with all the available table names. Select the required tables to populate data. If the database import is not completed, it will open a blank page without any tables.
Specify the number of rows required in each table. If the table is having foreign key, we can specify the related Table. Ratio to Related Table indicates the relationship type as one to one, many to one, one to many or many to many.
You can configure the data generation method or how to generate the data for each column. By default, it will configure the values depends on the data type of the column.
5. Generate Data
Once the configuration completes, select Generate Data icon or F5 to execute the Data Generation Plan. We can either delete the data from the tables or add data to existing table.
6. Verify the Data
Open the Orders table to verify the data. Orders table have 1000 records with random data.
Data Generation Plan available in Visual Studio helps us to populate the database with bulk amount of data. This will help in volume testing the application and also able to find whether any deadlock scenario or performance degradation is there in the application with data volume increase.