Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Populating your database with a few clicks

Populating your database with a few clicks

Ratings: (0)|Views: 44 |Likes:
Published by José Carréra
Article published on Testing Experience Magazine, issue December 2010. Describing Data Generator open source tool.
Article published on Testing Experience Magazine, issue December 2010. Describing Data Generator open source tool.

More info:

Published by: José Carréra on Dec 07, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/26/2011

pdf

text

original

 
The Magazine for Professional Testers
December 2010
    I    S    S    N   1    8    6    6  -   5   7   0   5    w   w   w .    t   e   s    t    i   n   g   e   x   p   e   r    i   e   n   c   e .   c   o   m     f   r   e   e    d    i   g    i    t   a    l   v   e   r   s    i   o   n    p   r    i   n    t   v   e   r   s    i   o   n    8 ,   0   0    €   p   r    i   n    t   e    d    i   n    G   e   r   m   a   n   y
Open Source Tools
12
© diego cervo - Fotolia.com
 
82
The Magazine for Professional Testerswww.testingexperience.com
Populating your databasewith a few clicks
by José Carréra
© Stephan Koscheck - Fotolia.com
A common obstacle frequently faced by the testing team is thechallenge of having to check several testing scenarios which re-quire very large amounts of data that could take months to beobtained in a real production environment. Also, depending onthe domain of the application, it may just not be possible to havethe data made available from production environment due to se-curity or privacy issues. Therefore, quality assurance teams needto nd other ways to simulate these scenarios as closely as pos-sible to real environments, whilst at the same time they usuallyface strict time constraints, which makes their work even harder.Test engineers have at their disposal some solutions to deal withthis matter. However, they are not always easy to use or are notfast enough. A commonly used approach is to create SQL scriptsmanually using a text editor, which is a tedious task that consu-mes a lot of time. Another possibility is to use specic tools to aidin this task, allowing the user to quickly and easily generate largeamounts of data. However, it is not easy to nd a suitable open-source tool that is exible enough to adapt to any type of scenarioand all data types.A couple of months ago I was introduced to the
Data Generator
tool, which according to the website www.generatedata.com is„a free, open-source script written in JavaScript, PHP and MySQLthat lets you quickly generate large volumes of custom data in avariety of formats for use in testing software, populating databa-ses, and scoring with girls“. I still haven‘t discovered how the toolmay help you „score with girls“, but it sure is a great tool to assistsoftware testing in populating databases.In this article I will describe the main features of this application,pointing out ways to better use these features based on our pre-vious experience using
Data Generator
in our projects.
First Look and Installation
The rst great thing about the
Data Generator
tool is that youcan try it out without having to install it. After accessing theapplication‘s website www.generatedata.com and clicking onthe Generator tab, you will be presented with that same web GUIthat you will have if you later on decide to install it locally on yourmachine. The only constraint is that using this “demonstration”
Image 1 - Website Generator version
 
83
The Magazine for Professional Testerswww.testingexperience.com
version you can only create a maximum of 200 records at a time,whereas with the locally installed version you may reach 5000 re-cords at a time.To install it locally on your machine only a few simple steps needto be performed. By clicking on the download tab at the website you can see what the system requirements are:MySQL 4+PHP 4+Any modern, JS-enabled browserTo fulll these requirements we installed
WampServer
(www.wampserver.com), another free, open-source project, which al-lows us to run Data Generator and all its features. After installingWampServer just a couple more steps need to be performed. Tostart running Data Generator locally on your machine, a simpleve- step installation procedure is available via the download tabof the application‘s website. For
Data Generator
version 2.1, whichis the version we used in our projects, the required steps are:1. Download the zip-le at the top and unzip the contents lo-cally on your computer.2. In the zip-le, you‘ll nd a le in the /install folder nameddb_install.sql. This contains all the SQL to create the MySQLtables and raw data used by the Data Generator (names, ci-ties, provinces, states, countries, etc). You will need to execu-te these statements on your database through any databaseaccess tool, such as phpMyAdmin.3. Edit the global/library.php le. At the top, you‘ll see a sec-tion where you need to enter your MySQL database settings.Note: if you choose to change the database prex, make sure you rename the tables after running the SQL in #2!4. Upload all les to your web server.5. Upload it to your web browser and get to work.After this small procedure, you can start using
Data Generator
.As we will describe in the next section, it comes with a pre-loadeddatabase that might help you in several test scenarios.
Explaining its main features
First, I will describe how we can use the pre-loaded user databa-se to generate data. Almost all applications have a user manage-ment feature that uses data like name, phone, e-mail, address,etc. It is also common that at some point during the project lifecycle we need to use a larger amount of user data, in order to as-sess how the system behaves in dierent test scenarios that mayfocus on features like response time, data integrity, general userinterface, and many others.On the Data Generator main screen you will be able to dene oneach row a data type for each column of the table that you wantto populate. For each row, the user can dene a column title andits data type along with its specic settings. Dierent types of pre-loaded data types will be available like: name, phone/fax, e-mail, city, and others. These data types allow us to solve dierentissues, by attending various test scenarios.
Image 2 - Available data typesImage 3 - Dates / pre-dened formats

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->