Click here to Skip to main content
Click here to Skip to main content

How to generate test data?

, 24 Nov 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
During testing phase you would like to generate range of test data so that you can test your application properly. Most of the times testers end up doing monkey testing or exploratory testing.
The biggest problem with codeproject.com tips and tricks section is I cannot upload images. This tip needs images for better understanding.
 
So in case the below text is not sufficient to understand how to use this tip you can also see this video which goes step by step http://www.youtube.com/watch?v=8R3-xgmOTeE
 
If you do not want to watch that 10 min long video and do a quick read below is the text which explains the tip.
 
During testing phase you would like to generate range of test data so that you can test your application properly. Most of the times testers end up doing monkey testing or exploratory testing. In other words they start hitting the application with various permutation and combination of data to see if the validations are appropriate. It’s very much possible that your tester can leave some combinations out.
 
So the answer is use the data generation plan template from SQL Server project.
 
Click on visual studio, create a SQL Server database project and add data generation plan template to your project. In that template you can use regular expression to generate various combinations of data.
 
For instance let’s say you want to generate test data for invoice number with following constraints:-
 
Validation 1:- Invoice number should always start with INV and rest of the part should be numeric. INV1001 INV2003
 
Validation 2:- Invoice number should be in the length range of 4 to 8.
 
You can specify in regular expression INV [0-9]{4,8} and rest the template will do the work.
 
You should get something as shown below.
 
INV1001
INV2
INV567
INV0122
INV1001
INV590
INV9023
INV0127

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Shivprasad koirala
Architect http://www.questpond.com
India India

I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small
E-learning company in India. We are very much active in making training videos ,
writing books and corporate trainings. Do visit my site for 
.NET, C# , design pattern , WCF , Silverlight
, LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server  training 
and Interview questions and answers


Comments and Discussions

 
General/*<i>The biggest problem with codeproject.com tips and trick... Pinmvpthatraja24-Nov-11 23:05 
GeneralRe: I can do in articles but not in the tips and tricks section.... PinmemberShivprasad koirala25-Nov-11 2:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141223.1 | Last Updated 25 Nov 2011
Article Copyright 2011 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid