Click here to Skip to main content
15,867,325 members
Articles / DevOps / Testing
Tip/Trick

How to generate test data?

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
24 Nov 2011CPOL1 min read 39.5K   5   2
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

For further reading do watch the below interview preparation and step by step video series.

License

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


Written By
Architect https://www.questpond.com
India India

Comments and Discussions

 
General/*<i>The biggest problem with codeproject.com tips and trick... Pin
thatraja24-Nov-11 22:05
professionalthatraja24-Nov-11 22:05 
GeneralRe: I can do in articles but not in the tips and tricks section.... Pin
Shivprasad koirala25-Nov-11 1:16
Shivprasad koirala25-Nov-11 1:16 

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

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