{"id":837,"date":"2006-08-09T05:47:22","date_gmt":"2006-08-09T05:47:22","guid":{"rendered":"\/blogs\/bobb\/post\/Non-intuitive-test-data-leads-to-proper-constraints.aspx"},"modified":"2006-08-09T05:47:22","modified_gmt":"2006-08-09T05:47:22","slug":"non-intuitive-test-data-leads-to-proper-constraints","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/","title":{"rendered":"Non-intuitive test data leads to proper constraints?"},"content":{"rendered":"<p><P>Sometimes I&#8217;ll have these interesting juxtapositions of two or more projects I&#8217;m working on at the same time. So what does Joe Celko have to do with the Visual Studio &#8220;Data Dude&#8221; (VSTSDD for short, I don&#8217;t know what the official acronym is yet) product? Well&#8230;<\/P><br \/>\n<P>The first time I generated test data with VSTSDD, I was kind of surprised because it was SO random. Odd conglomerations of characters covering every bit of a data type&#8217;s value space. I was used to more &#8220;regular&#8221; test data, like&#8230;<\/P><br \/>\n<P>I&#8217;d once worked on a VISA card system in the 80s that had about 100 or so completely made up test customers with real-sounding names. We&#8217;d run system tests (15 cycles if I remember correctly) that generated a few boxes of green-bar reports. BUT. The made up customers *had histories* so real that our users (who actually read the test reports) knew them better than our real customers. They could tell, for example that if &#8220;Fred Anderson&#8221; didn&#8217;t go over his credit-limit on cycle 12, there was a problem with our latest change on the test system. REALLY. <\/P><br \/>\n<P>I couldn&#8217;t see how any users would remember test names that consisted of 25 &#8220;random edge-of-the-value-range&nbsp;characters&#8221;. I know you can write your own test data generator, but, I was a bit disappointed. At first.<\/P><br \/>\n<P>So I&#8217;m reading Joe&#8217;s book &#8220;SQL Programming Style&#8221;. Rules 3.8.1 and 3.8.2: &#8220;Consider range constraints for numeric values.&#8221; And. &#8220;Consider LIKE and SIMILAR TO constraints for character values.&#8221; Hmmm&#8230;<\/P><br \/>\n<P>So, although the test &#8220;names&#8221; aren&#8217;t particularly memorable, they exercise the ENTIRE allowed value space, preventing&nbsp;surprises in the case where someone has a name containing edge cases of characters, or numeric values at the end of the range. Forcing the needed constraints or procedure corrections. Great!<\/P><br \/>\n<P>Because&#8230; (back to the book)&nbsp;&#8220;Look at the actual DDL and see how often you find this constraint. Programmers are lazy and do not bother with this level of details&#8221;. <\/P><br \/>\n<P>Not any more, I guess. <\/P><br \/>\n<P>I&#8217;d like to see how our users would have pronounced those character combinations and numeric values. Or they&#8217;d never encounter them because of proper constraints. Very cool.<\/P><br \/>\n<P><\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes I&#8217;ll have these interesting juxtapositions of two or more projects I&#8217;m working on at the same time. So what does Joe Celko have to do with the Visual Studio &#8220;Data Dude&#8221; (VSTSDD for short, I don&#8217;t know what the official acronym is yet) product? Well&#8230; The first time I generated test data with VSTSDD, [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-837","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.9.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Non-intuitive test data leads to proper constraints? - Bob Beauchemin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Non-intuitive test data leads to proper constraints? - Bob Beauchemin\" \/>\n<meta property=\"og:description\" content=\"Sometimes I&#8217;ll have these interesting juxtapositions of two or more projects I&#8217;m working on at the same time. So what does Joe Celko have to do with the Visual Studio &#8220;Data Dude&#8221; (VSTSDD for short, I don&#8217;t know what the official acronym is yet) product? Well&#8230; The first time I generated test data with VSTSDD, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/\" \/>\n<meta property=\"og:site_name\" content=\"Bob Beauchemin\" \/>\n<meta property=\"article:published_time\" content=\"2006-08-09T05:47:22+00:00\" \/>\n<meta name=\"author\" content=\"Bob Beauchemin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bob Beauchemin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/\",\"name\":\"Non-intuitive test data leads to proper constraints? - Bob Beauchemin\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\"},\"datePublished\":\"2006-08-09T05:47:22+00:00\",\"dateModified\":\"2006-08-09T05:47:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Uncategorized\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/uncategorized\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Non-intuitive test data leads to proper constraints?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/\",\"name\":\"Bob Beauchemin\",\"description\":\"SQL Server Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e\",\"name\":\"Bob Beauchemin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g\",\"caption\":\"Bob Beauchemin\"},\"sameAs\":[\"http:\/www.sqlskills.com\/blogs\/bobb\/\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Non-intuitive test data leads to proper constraints? - Bob Beauchemin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/","og_locale":"en_US","og_type":"article","og_title":"Non-intuitive test data leads to proper constraints? - Bob Beauchemin","og_description":"Sometimes I&#8217;ll have these interesting juxtapositions of two or more projects I&#8217;m working on at the same time. So what does Joe Celko have to do with the Visual Studio &#8220;Data Dude&#8221; (VSTSDD for short, I don&#8217;t know what the official acronym is yet) product? Well&#8230; The first time I generated test data with VSTSDD, [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/","og_site_name":"Bob Beauchemin","article_published_time":"2006-08-09T05:47:22+00:00","author":"Bob Beauchemin","twitter_misc":{"Written by":"Bob Beauchemin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/","name":"Non-intuitive test data leads to proper constraints? - Bob Beauchemin","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website"},"datePublished":"2006-08-09T05:47:22+00:00","dateModified":"2006-08-09T05:47:22+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/non-intuitive-test-data-leads-to-proper-constraints\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/"},{"@type":"ListItem","position":2,"name":"Uncategorized","item":"https:\/\/www.sqlskills.com\/blogs\/bobb\/category\/uncategorized\/"},{"@type":"ListItem","position":3,"name":"Non-intuitive test data leads to proper constraints?"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/","name":"Bob Beauchemin","description":"SQL Server Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/bobb\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/62bfa986c5b5d28fcffd8b4fc409c73e","name":"Bob Beauchemin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/bobb\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f80e6cc667410857fa6a21931dc528b8092f4d112bf7a8ff7c267674d44ee37?s=96&d=mm&r=g","caption":"Bob Beauchemin"},"sameAs":["http:\/www.sqlskills.com\/blogs\/bobb\/"],"url":"https:\/\/www.sqlskills.com\/blogs\/bobb\/author\/bobb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/comments?post=837"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/posts\/837\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/media?parent=837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/categories?post=837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/bobb\/wp-json\/wp\/v2\/tags?post=837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}