top of page
Search
tatgehouwipy

Create Fake but Realistic Data for SQL Server with Red Gate Sql Test Data Generator



At some point during the development lifecycle someone, be it a developer, QA, or a business owner, asks for "real" data to test against. Typically this is for two reasons, they want the volume of data to match production, or the "fake" data doesn't make any sense. A request such as this came across my desk this week for a load test. Rather than use production data, I thought this would be a good opportunity to try out Redgate's SQL Data Generator Tool.




Red Gate Sql Test Data Generator



Redgate's SQL Data Generator was written for this very scenario, generating data for testing. How it works is it reads the schema of the database and determines the type of data needed. If the column is a date, it will generate random date data. If the column is a varchar, it will generate random strings. The same for ints, bits, and so on.


Random strings, such as AG4f3dks, are typically not very helpful. But the folks over at Redgate have thought that through. SQL Data Generator also looks at the column names and compares that against a rules engine. If the name matches a rule, it will instead generate pre-defined data. Chances are you probably have a column in your database called FirstName or NameFirst. SQL Data Generator will see that column name and populate that column with a set of predefined first names.


Except for one little problem. The data was too random. If such a thing existed. The person working on the load test told me his tests weren't going to be testing as close to production as possible. In addition to that, the scope changed. Another person doing the testing was hoping to use the same data set to do some manual testing.


Side Note: What's funny is no matter where I work this is the most requested item. People want the data to match production, but with all the PII data scrubbed. I can see their point; it helps with their testing. Random data serves no purpose; it needs context.


One thing to note about randomizing PII data. Be sure the business doesn't require address verification using Melissa data. SQL Data Generator will generate random addresses which will fail that check. You might also have other business rules, in that case, you will need to make use of Python scripts. I didn't have to do this, so I never had the chance to capture a screenshot. Here is another one from Redgate!


The power of SQL Data Generator is the ability to target specific columns and tables to generate random data for. All the other tables, lookup tables, tables not containing PII data, and so on, can be pulled in as is. Not only can I generate data for testers to use, but I can also generate data for developers to have for their local SQL Server instances. Being able to do that, I see SQL Data Generator as a handy tool in Software Development Lifecycle and Database Lifecycle Management processes.


Another issue is usability. One of the primary ideas of a test cycle is that it allows the app owner to experience what the software will be like once it rolls out. Many of the functions they need to perform in order to fully experience the product are dependent on the presence of data. A customer management app, for example, is going to be very hard to test without a good set of customer records.


There is also a bulk uninstall tool now available on the latest versions of our products. If you visit the same location and opt to uninstall one of your Redgate products it will give you the option to uninstall them all by checking the box to select all.


It's for users of Redgate's SQL Change Automation. The tools help usersmanage databases alongside application code in agile processes. The SQLChange Automation tool plugs into Jenkinsto enable continuous integration for your SQL Server databases.


He described it as "a local database that you can run on your desktop, and it's a single-user, single-instance, on-demand activated version of SQL Server. An incredibly cool, lightweight, test-and-debug feature, if you will." The new feature was revealed when the duo did an F5 project build in Visual Studio and chose the database runtime as the deployment target. Gibson said the new runtime can be used for applications, but the main use for database developers will be for testing and debugging.


Young summarized the state of the latest version of Connector/NET (6.3) and where it's going: "We have Visual Studio 2010 compatibility. We have support for .NET 4.x and we go back to 2.x as well, so if you're using an older version and haven't upgraded yet, our Connector will work back a couple of versions. We've also got this Model First development using the Entity Framework, so Connector 6.x will support that, so you can actually develop objects, tables, that type of thing, within the Entity Framework environment and then forward-engineer those into actual DBL and ultimately into database objects. If you're familiar with the SQL Server editor within Visual Studio, the MySQL editor looks, basically, exactly the same."


Catherine Wilhelmsen (blt) offers a completely different and refreshing view on tools that were completely new to me, at least. Going from database modeling to data generators to time keeping tools and beyond. 2ff7e9595c


1 view0 comments

Recent Posts

See All

Comments


bottom of page