Share via


Killer feature of VSTS DB Pro - data generation via regex

IMHO, while the DB Pro SKU has lots to like, one of the features I fell in love with the moment I heard about it was their data generation via regex.

Why is that?  Because even today, sometimes the most testing your data code gets in terms of valid/invalid values are those few, all too often overly simple, unit tests where you verified that (for instance) 0xFFFF or 0x0000 was caught as an invalid character or whatnot.  Sometimes you're even better and remember to throw in a few test cases to verify you don't have a Turkish I or Cyrillic E problem.  Sometimes.

But with data generation like this, I'm looking forward to having lots of interesting values tested through the data paths.  Even better, I think it will force a lot of conversations that weren't happening before.  Encodings supported, byte length vs. character length, max supported lengths, embedded chars in strings like single-quote to help expose like sql string generation by concatenation (sql injection attacks are BAD :), etc. etc. etc.

https://blogs.msdn.com/gertd/archive/2006/11/26/regex-is-your-friend.aspx

The power of VSTE DBPro data generation, lays in the fact you can generate data that closely matches your domain values allowed in your environment. The problem is that knowledge of the allowed and disallowed domain values can not always be derived from the schema, so you have to go in to the designer and configure the generators for your columns.

One way to generate data that matches you needs is to use the Regular Expression generator, but using regular expressions can be intimidating, so here a simple list of example RegEx expressions that you can "re-use" in your environment.