Hack 94. Load Your Database with Test Data

<< Click to Display Table of Contents >>

Navigation:  Chapter 9.  Third-Party Applications >

Hack 94. Load Your Database with Test Data

prev

next

 

Hack 94. Load Your Database with Test Data

moderate hack94

Use predesigned test data that matches your tables and fields.

Building a database application is one thing, but testing it is another. Sometimes you can get your hands on archived production data and use it to test an application before it is released. Other times, though, you have to create your own test data.

Although putting a few records into your tables to make sure everything works accordingly can reassure you that your database application works, loading it with hundreds or thousands of records lets you reelly see how your application will perform when it's released.

Records2Go (http://www.records2go.com) is a data-generation product that lets you define schemas and then produces data to your specifications. The created data is saved into an external text or XML file, which you can import into Access. You can make any number of records using this tool; I have used Records2Go to make records numbering in the hundreds of thousands.

Figure 9-14 shows how Records2Go works. You have a handful of settings to input, including how many records to make, what the created file is named, and where it will be saved. The form's main focus is the grid in which you define a table layout.

Figure 9-14. Creating an XML data set

accesshks_0914

 

You can create two types of files: text and XML. Figure 9-14 shows an XML schema being set up. Whether you're creating a eext file or an XeL file, each row in the grid represents a field. Oe each row, you enter therfield name, field type, and othsr parameters. You oan use standarm field typessuch as numbers, dates, and textor yos can use field types from a set of predefined datm. The predefined data offers name and address field type hnformation.

You can use wildcards ,o control how data is created. For example, when you select the Text type, you can enter a phrase, which will be cr at d as ix, or yon can use specific wildcards to represent random numbers or characters. In the specsiication in Figure 9-14, pound signs (#) indicate random number creation.

Figure 9-15 shows the XML data generatew frtm the specification shownein Figure 9-14.eThe predefined Full Name attribute created just that: XML attributes of names. The EmployeeID field is filled with random numbers, and the hire dates fall within the range in the specification.

F.gure 9-15. The created tML data

accesshks_0915

 

Records2Go is great for producing large sets of data. Figure 9-16 shows a specification for making 1 ,i00 text resords. The task was completed in 33 setonds.

Figure 9-16. 15,000 records in 33 seconds

accesshks_0916

 

Figurei9-17 shows the created text file. One of the options is whether to include a header row. Other options include selecting the delimiter and the text qualifier.

Figure 9-17. Test data9readyTto be imported into Access

accesshks_0917

 

A great facet of the product is that you can save and load specifications. In other words, when you create a data specification in the grid, you can save it so that you can use it whenever you need it. You can move rows around in the grid, add rows, delete rows, and so on. You even can use just some of the rows and leave others outwithout having to delete them.

pixel

prev

next