Friday, March 27, 2009

Quantified String Generator

After reading my previous post "The Magic of Size Based File Generator" many of my friends had explored other features of Testersdesk.com and told me to continue posting about other features.

Let us have a look at the tool “Quantified String Generator” of Testersdesk.com.
If you need to test a field that accepts 255 characters maximum, we test it by passing 255 characters and 256 characters. We prepare 255 character length string and paste it in the field, but how do we know that all the 255 characters are pasted in that field? We again copy the string from the field and paste it in a word doc and check the word count. How many times in a day we do this for different fields and imagine how much time this is taking.

By using the tool “Quantified String Generator” of Testersdesk.com, we can generate Quantified Strings - Strings that can indicate the position of a character anywhere within. See the below image of the tool:

If you want to generate a 255 characters length string, enter “255” in “Text Length” field and click on “Generate Quantified text” button. A 255 characters length string will be generated which will be in the below format:
$3$5$7$9$12$15$18$21$24$27$30$33$36$39$42$45$48$51$54$57$60$63$66$69$72$75$78$81$84$87$90$93$96$100$104$108$112$116$120$124$128$132$136$140$144$148$152$156$160$164$168$172$176$180$184$188$192$196$200$204$208$212$216$220$224$228$232$236$240$244$248$252$256
In the above string you can see $ separated by numbers, each number in the string specifies the position of the next $ character.
Let us say when the above generated 255 characters string is pasted in a field and the string is pasted as below:
$3$5$7$9$12$15$18$21$24$27$30$33$36$39$42$45$48$51$54$57$60$63$66$69$72$75$78$81$84$87$90$93$96$100$104$108$112$116$120$124$128$132$136$140$144$148$152$156$160$164$168$172$176$180$184$188$192$196$200$204$208$212$216$220$224$228$
As I said before that each number specifies the position of the next $ character, by seeing the above pasted string we can easily say that only 228 characters are pasted in the field. The advantage of this tool is that we can generate string up to 1000 characters and can also one can tell the string length by just seeing it.
There are other tools in “Common Test Data Generators” section of Testersdesk.com where we can generate strings in any language, random numbers etc. Do explore the other features as well. Contact me if you have any questions.

In early 2007, when I was testing an Installation Product, I use to prepare files of different sizes manually which used to kill half of my time.At that time we do not know about any free tools to generate files. Even after preparing those files and performing testing at the end of the day we used to delete them to reduce memory problems. This is a repeating manual mundane task that one has to perform before he/she knows about “Size Based File Generator” in Testersdesk.com.

I will also show how this tool works. Please follow the below steps and refer the screen shots provided for more details:

Step 1: Do register (I assure you that it is worth It.) and log on to http://www.testersdesk.com/

Step 2: Click on the Tab “Test Data Generation Toolkit – to generate test inputs” which will be as shown below:



Step 3:
Now you will see a set of test data generation tools in different boxes. Click on the box “Size Based File Generator”. Now you will see the tool opening with tool information in the right side of the page which will be as shown below:



Step 4: You will see three fields in this screen, one to provide the required file size, one to select the measurement unit (KB, MB or GB) of the file and the other to select the type of file (Mixed data, numeric, alphabets, Alphanumeric, Special Characters, Binary) i.e., one can select what type of data should be there in the generated file.


Step 5:Let us take a sample example to generate a file of size 2 MB, with alphanumeric data. Fill the fields as below:

  • Please provide the file size as a rounded integer: provide 2 as input
  • Please select a unit of measurement: Select MB from the drop down.
  • What type of data should be inserted into the generated file? : Select “Alphanumeric” from the drop down.which will be as shown below:



Step 6:
Click on “Download Windows Batch-file” button.


Step 7: After clicking on the button “Download Windows Batch-file”, you will see a “batch file” downloading on your machine. Save that “Batch file” anywhere on your machine, for example save it on your Desktop.


Step 8: Now you will see a batch file “SaveAndRunThis_Alphanumeric2MB(2)” saved on your desktop.


Step 9: Double click on that batch file saved on your desktop to create a 2 MB, Alphanumeric file on your desktop. You can open the 2 MB file created and see that it consists of alphanumeric data. The batch file created is very small in size when compared with the file created. The main advantage here is that you can delete the file created after using it and save the batch file so that you can create the file whenever you need it. Please see below image for more details:



Do explore the other tools as well at http://www.testersdesk.com/
which are useful in the areas of test design and test data preparation.