Visual Studio Data Generation Plan

Ambily.raj
Posted by in Visual Studio category on for Intermediate level | Points: 250 | Views : 22270 red flag
Rating: 5 out of 5  
 2 vote(s)

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.


 

Conclusion

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.

 

Page copy protected against web site content infringement by Copyscape

About the Author

Ambily.raj
Full Name: Ambily KK
Member Level: Silver
Member Status: Member,Microsoft_MVP,MVP
Member Since: 5/18/2010 1:05:25 AM
Country: India
Thanks Ambily K K http://ambilykk.com/
http://ambilykk.com/
I have over 9 years of experience working on Microsoft Technologies. I am carrying the passion on Microsoft technologies specifically on web technologies such as ASP .Net and Ajax. My interests also include Office Open XML, Azure, Visual Studio 2010. Technology adoption and learning is my key strength and technology sharing is my passion.

Login to vote for this post.

Comments or Responses

Posted by: Karthikanbarasan on: 2/9/2011 | Points: 25
Nice article!!!
Posted by: Ambily.raj on: 2/9/2011 | Points: 25
Thanks.

Ambily
Posted by: Samarmir on: 2/10/2011 | Points: 25
This is an excellent article.
Very interesting. It would be nice to see more on this subject.
Another thing, you mentioned: "through different types of tests like Web Test, Load Test, etc.."
Would it be possible for you to make articles on these subjects to (web test, load test, unit test)?

Again thanks for a nice article.

Sincerely
Mohammad
Posted by: Ambily.raj on: 2/10/2011 | Points: 25
Hi Mohammad

Thanks.
You can find my previous articles on web Test and Load test.

http://www.dotnetfunda.com/articles/article901-web-performance-test-using-visual-studio-part-i-.aspx
http://www.dotnetfunda.com/articles/article951-web-performance-test-using-visual-studio-part-ii-.aspx

I will be writing more on Unit Test, Ordered Test, etc.

Thanks
Ambily
Posted by: Ranjit.r200 on: 8/12/2011 | Points: 25
Hi
I have one issue regarding the test data generation with data generation plan.

How to control [number of rows/data] Ratio of possible generated values in a column?

For example:

"Visit" table has "Visit Type" with possible values 'InPatient','OutPatient','Emergency'.


I may want to generate the data in a manner like "20% of generated data should be 'Emergency'" ,

"60% 'InPatient'" and the rest "20% 'OutPatient'".

Regards,

Ranjeet


Login to post response

Comment using Facebook(Author doesn't get notification)