DataDoctor.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Beware of data generators &mdash; baangt 1.1.1 documentation</title>
  8. <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
  9. <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
  10. <script type="text/javascript" src="../_static/jquery.js"></script>
  11. <script type="text/javascript" src="../_static/underscore.js"></script>
  12. <script type="text/javascript" src="../_static/doctools.js"></script>
  13. <script type="text/javascript" src="../_static/language_data.js"></script>
  14. <script type="text/javascript" src="../_static/js/theme.js"></script>
  15. <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  16. <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  17. <link rel="stylesheet" href="../_static/theme_overrides.css" type="text/css" />
  18. <link rel="index" title="Index" href="../genindex.html" />
  19. <link rel="search" title="Search" href="../search.html" />
  20. <link rel="next" title="baangt In Industries" href="BaangtIndustries.html" />
  21. <link rel="prev" title="Why your production sucks and how to fix it" href="ProductionSucks.html" />
  22. </head>
  23. <body class="wy-body-for-nav">
  24. <div class="wy-grid-for-nav">
  25. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  26. <div class="wy-side-scroll">
  27. <div class="wy-side-nav-search" >
  28. <a href="../index.html" class="icon icon-home"> baangt
  29. </a>
  30. <div role="search">
  31. <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
  32. <input type="text" name="q" placeholder="Search docs" />
  33. <input type="hidden" name="check_keywords" value="yes" />
  34. <input type="hidden" name="area" value="default" />
  35. </form>
  36. </div>
  37. </div>
  38. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  39. <p class="caption"><span class="caption-text">Contents:</span></p>
  40. <ul class="current">
  41. <li class="toctree-l1"><a class="reference internal" href="../Installation.html"> Installation</a></li>
  42. <li class="toctree-l1"><a class="reference internal" href="../OverviewUsage.html"> Overview</a></li>
  43. <li class="toctree-l1"><a class="reference internal" href="../simpleExample.html"> First Steps</a></li>
  44. <li class="toctree-l1"><a class="reference internal" href="../Structure.html"> Structure</a></li>
  45. <li class="toctree-l1"><a class="reference internal" href="../ParametersConfigFile.html"> Parameters</a></li>
  46. <li class="toctree-l1"><a class="reference internal" href="../SimpleAPI.html"> First API Test</a></li>
  47. <li class="toctree-l1"><a class="reference internal" href="../TestTypes.html"> Types of Tests</a></li>
  48. <li class="toctree-l1"><a class="reference internal" href="../DataFile.html"> Data file</a></li>
  49. <li class="toctree-l1"><a class="reference internal" href="../SaveResults2Database.html"> Results in Database</a></li>
  50. <li class="toctree-l1"><a class="reference internal" href="../HistoryAndReasons.html"> History</a></li>
  51. <li class="toctree-l1"><a class="reference internal" href="../contributors.html"> Contributions</a></li>
  52. <li class="toctree-l1"><a class="reference internal" href="../changelog.html"> Changelog</a></li>
  53. <li class="toctree-l1"><a class="reference internal" href="../PlannedFeatures.html"> Planned Features</a></li>
  54. <li class="toctree-l1"><a class="reference internal" href="../BrowserDrivers.html"> Browser Drivers</a></li>
  55. <li class="toctree-l1"><a class="reference internal" href="../Variables.html"> Variables</a></li>
  56. <li class="toctree-l1"><a class="reference internal" href="../SendStatistics.html"> Results</a></li>
  57. <li class="toctree-l1"><a class="reference internal" href="../Datagenerator.html">DataGenerator</a></li>
  58. <li class="toctree-l1"><a class="reference internal" href="../Datagenerator.html#input-file">Input File</a></li>
  59. <li class="toctree-l1"><a class="reference internal" href="../Datagenerator.html#data-type">Data Type</a></li>
  60. <li class="toctree-l1"><a class="reference internal" href="../Datagenerator.html#all-data-types-format">All Data Types Format</a></li>
  61. <li class="toctree-l1"><a class="reference internal" href="../Developer.html"> For Developers</a></li>
  62. <li class="toctree-l1"><a class="reference internal" href="../baangt-Plugin.html">What is a baangt-plugin</a></li>
  63. <li class="toctree-l1"><a class="reference internal" href="../baangt-Plugin.html#how-to-make-a-baangt-plugin">how to make a baangt-plugin</a></li>
  64. <li class="toctree-l1"><a class="reference internal" href="../baangt-Plugin.html#how-the-baangt-plugin-work">how the baangt-plugin work</a></li>
  65. <li class="toctree-l1"><a class="reference internal" href="../baangt-Plugin.html#how-to-replace-the-existing-plugin-by-your-own-one">how to replace the existing plugin by your own one</a></li>
  66. <li class="toctree-l1 current"><a class="reference internal" href="Articles.html"> :subheader: Articles</a><ul class="current">
  67. <li class="toctree-l2"><a class="reference internal" href="ProductionSucks.html"> Production sucks</a></li>
  68. <li class="toctree-l2 current"><a class="current reference internal" href="#"> Test data rulez</a><ul>
  69. <li class="toctree-l3"><a class="reference internal" href="#what-do-we-use-instead-of-random-generated-data">What do we use <strong>instead</strong> of random generated data?</a></li>
  70. <li class="toctree-l3"><a class="reference internal" href="#that-s-all-nice-but-it-won-t-work-for-us-because">That’s all nice, but it won’t work for us because …</a></li>
  71. <li class="toctree-l3"><a class="reference internal" href="#tl-dr">tl;dr</a></li>
  72. </ul>
  73. </li>
  74. <li class="toctree-l2"><a class="reference internal" href="BaangtIndustries.html"> Industries 4 baangt</a></li>
  75. <li class="toctree-l2"><a class="reference internal" href="StopTesting.html"> Stop testing!</a></li>
  76. <li class="toctree-l2"><a class="reference internal" href="AgileWorkflowIntegration.html"> bAanGtILE</a></li>
  77. <li class="toctree-l2"><a class="reference internal" href="BugSoup.html"> BugSoup</a></li>
  78. <li class="toctree-l2"><a class="reference internal" href="AsynchronousAndCanonTests.html"> Canons, that are not DSLR nor music</a></li>
  79. <li class="toctree-l2"><a class="reference internal" href="SeleniumGridV4WithBaangt.html"> SeleniumGridV4</a></li>
  80. </ul>
  81. </li>
  82. <li class="toctree-l1"><a class="reference external" href="http://www.baangt.org"> Web</a></li>
  83. </ul>
  84. <p class="caption"><span class="caption-text">Autodocs:</span></p>
  85. <ul>
  86. <li class="toctree-l1"><a class="reference internal" href="../docs/baangt.base.html">Autodocs</a></li>
  87. <li class="toctree-l1"><a class="reference internal" href="../docs/modules.html">Modules</a></li>
  88. </ul>
  89. </div>
  90. </div>
  91. </nav>
  92. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  93. <nav class="wy-nav-top" aria-label="top navigation">
  94. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  95. <a href="../index.html">baangt</a>
  96. </nav>
  97. <div class="wy-nav-content">
  98. <div class="rst-content">
  99. <div role="navigation" aria-label="breadcrumbs navigation">
  100. <ul class="wy-breadcrumbs">
  101. <li><a href="../index.html">Docs</a> &raquo;</li>
  102. <li><a href="Articles.html">Not Exactly Documentation</a> &raquo;</li>
  103. <li>Beware of data generators</li>
  104. <li class="wy-breadcrumbs-aside">
  105. <a href="../_sources/articles/DataDoctor.rst.txt" rel="nofollow"> View page source</a>
  106. </li>
  107. </ul>
  108. <hr/>
  109. </div>
  110. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  111. <div itemprop="articleBody">
  112. <div class="section" id="beware-of-data-generators">
  113. <h1>Beware of data generators<a class="headerlink" href="#beware-of-data-generators" title="Permalink to this headline">¶</a></h1>
  114. <p>In time of big data and machine learning when we see the difficulties to find proper data for test automation we’re tempted
  115. to turn to the silver bullet “RPA” (Robotic Process Automation). Solutions grow like mushrooms, all with the intention to
  116. reduce effort for test data creation and test case maintenance.</p>
  117. <p>We also use test data generators in <code class="docutils literal notranslate"><span class="pre">baangt</span></code>, very well dosed, very carefully and <strong>never</strong> to assess, whether the AUT
  118. (Application Under Test) is suitable for production. We use test data generators based on users data recordings to harden
  119. the application in early stages. We’ll “play” around (automatically), perform random clicks in random orders on buttons,
  120. extend each field to it’s maximum length, fill traditional chinese characters into arabic text fields and similar tests.</p>
  121. <p>That’s a valuable excercise. It helps to harden the application before the masses of end-users will try
  122. to beat it down. But we use those tests not in daily or weekly regression tests or when we assess the latest build or
  123. increment.</p>
  124. <div class="section" id="what-do-we-use-instead-of-random-generated-data">
  125. <h2>What do we use <strong>instead</strong> of random generated data?<a class="headerlink" href="#what-do-we-use-instead-of-random-generated-data" title="Permalink to this headline">¶</a></h2>
  126. <p>Beautifully, precious, manually designed and recorded test data from the business department (preferably key-users or even
  127. power end-users). We extend the dataset whenever a new issue arises in the production if in the post-mortem phase of
  128. the issue it turns out, that regression testing could have identified the issue with proper data.</p>
  129. <p>As this test set grows in lines, it grows in value. After a few weeks you’ve covered tests for all your major business logic
  130. within the test set. Depending on your product cycles it might mean a hell of maintenance effort (e.g. if your pricing changes
  131. every hour or day, you’ll either subclass the assertion methods with your own logic or you’ll be miserable updating 1000s
  132. of comparison values in the test data), but this effort might very well lead to keeping customers (as opposed to losing them
  133. to competition, if your software is unstable), supporting your whole organization to deliver the highest possible performance
  134. (by having reliable software and processes in place).</p>
  135. </div>
  136. <div class="section" id="that-s-all-nice-but-it-won-t-work-for-us-because">
  137. <h2>That’s all nice, but it won’t work for us because …<a class="headerlink" href="#that-s-all-nice-but-it-won-t-work-for-us-because" title="Permalink to this headline">¶</a></h2>
  138. <p>The more you depend on software and the more complex your software and processes are, the less I believe, that it is
  139. not possible in your case to run your regression tests with meaningful and reliable test data. Here’s a list of rather
  140. lame excuses. If you use any of them, please think again.</p>
  141. <table class="colwidths-given docutils align-default" id="id1">
  142. <caption><span class="caption-text">Anti-reasons for bad test data</span><a class="headerlink" href="#id1" title="Permalink to this table">¶</a></caption>
  143. <colgroup>
  144. <col style="width: 10%" />
  145. <col style="width: 40%" />
  146. <col style="width: 50%" />
  147. </colgroup>
  148. <thead>
  149. <tr class="row-odd"><th class="head"><p>Excuse</p></th>
  150. <th class="head"><p>Rant</p></th>
  151. <th class="head"><p>Grip</p></th>
  152. </tr>
  153. </thead>
  154. <tbody>
  155. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">too</span> <span class="pre">complex</span></code></p></td>
  156. <td><p>The software and processes are too complex. We’ve trillions of combinations. It would take months to test all that
  157. and in the end we anyway wouldn’t know, whether the results are right or wrong.</p></td>
  158. <td><p>System landscapes - especially grown ones - can be really complex. But at least try to find a good starting point
  159. by combining a few, beautifully crafted test cases and validation rules with ML Data expanders. It’s better than
  160. nothing and as your system stability improves and you need less time to fight fires in production, you’ll gain time
  161. to invest in improving your test data. You can start an uplifting spiral!</p></td>
  162. </tr>
  163. <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">no</span> <span class="pre">real</span> <span class="pre">data</span></code></p></td>
  164. <td><p>We don’t have good quality data in our stages.</p></td>
  165. <td><p>Often you’ll need basic or master data before you can test variations of transactional data. In a production company
  166. you’ll need material master data of raw materials, customer master data, vendor master data and much more before
  167. you can test your shiny new plant optimization system. But there are more benefits in investing time to create all those
  168. prerequisit master data automated.</p>
  169. <ul class="simple">
  170. <li><p>You can use this high quality data also for many other processes (billing, dunning, campaigning, MRP)</p></li>
  171. <li><p>After the next system copy, the same quality data is just one click away</p></li>
  172. <li><p>You can produce the same quality data for test clients, migration machines or wherever else you need them</p></li>
  173. </ul>
  174. <p>If the mountain of work is too big to tackle it all at once, slice it down to reasonable chunks. Identify, which
  175. data set has the highest value in terms of data quality/reliability of test case output and start with these.
  176. A classical example are customer master data. All your test cases are with “John Doe”. First real customer record
  177. without a ZIP-Code or strange address format for a certain country, phone number format, etc. breaks your tests.
  178. Don’t be like that. Or at least don’t be surprised, if it happens to you. Having a few hundred different customer
  179. master records, that you use in your test data base and recreate every now and then doesn’t take much of your time
  180. but provides a great deal of increased reliability of your test activities.</p>
  181. </td>
  182. </tr>
  183. <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">changes</span> <span class="pre">too</span> <span class="pre">fast</span></code></p></td>
  184. <td><p>Our internal and external customers are in need for speed. We can hardly finish the features we need to provide on time,
  185. let alone test them in E2E-Scenarios. No need for additional overhead. Our developers know, what they do!</p></td>
  186. <td><p>Good example of “famous last words”? Regression tests don’t need to run forever. Usually one would have approx.
  187. 10-15% in pure (and slow) UI-Tests, 40% of (faster) API-Tests and rely for the rest on earlier test stages (like unit tests).
  188. The less tests you execute, the higher the need for spotless and realistic test data! Yes, of course you can (and should)
  189. combine various test parameters into one E2E-Testcase (e.g. a specific/problematic country code with uncommon
  190. payment terms and a reopened order (instead of a freshly created one)). Better define a reasonable time frame for
  191. regression tests (given the fact, that they should run automatically, maybe a nightly build gives you 2-3 hours?).
  192. Then see, which systems take how long for each test case combination. Based on the time frame, the approximate number
  193. of testcases and the throughput you’ll understand, if and how much you need to run in parallel. With <code class="docutils literal notranslate"><span class="pre">baangt</span></code> you’ve
  194. the ability to run multiple TestCases in parallel and still receive exactly one result set.</p></td>
  195. </tr>
  196. <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Maintenance</span> <span class="pre">efforts</span> <span class="pre">too</span> <span class="pre">high</span></code></p></td>
  197. <td><p>Our changes are frequent and fast. We tried to use test automation, but we ended up spending more time with the automation
  198. then in development and in the end the reliability of the results was not worth the effort we invested.</p></td>
  199. <td><p>Understood. It is in fact true, that UI-Tests tend to need higher maintenance efforts than API-Tests. In <code class="docutils literal notranslate"><span class="pre">baangt</span></code>
  200. we addressed the problem of maintaining test case version with a simple and pretty versataile solution. If you need a
  201. test case to run on different software versions, which behave differently, you can simply adjust the “Release”-field
  202. in each Teststep (those, which are new from a certain release and those which are obsolete from a certain release, all
  203. others remain unchanged). Instead of having to have many different versions of testcases in parallel (and potentially
  204. the need to maintain all of them!) with <code class="docutils literal notranslate"><span class="pre">baangt</span></code> you’d have only one - unless you completely replace something
  205. (e.g. you replace credit card payment screen <strong>completely</strong> with payment by PayPal - then you’d most probably create
  206. a new testcase called “PayPal”).</p></td>
  207. </tr>
  208. <tr class="row-even"><td><p>‘Difficult to obtain data’</p></td>
  209. <td><p>We need real data, but it’s hard to come by. We’ve validation on Phone-Numbers, IBAN, BIC and many other fields,
  210. so we need to enter real data in test cases. But we don’t have it and we don’t want to use data from production!</p></td>
  211. <td><p>At least you’re not using your customers data for test - that’s great! Indeed for some data it’s pretty difficult
  212. to obtain valid test data - most of the time based on the reasoning, that if the mechanism to create valid data
  213. was made public it would support criminal activities.</p>
  214. <p>If you encounter such a need you’re in bad luck and your rant is granted. I assume, that your developer and API-Tests
  215. mock this interface/data anyway, so you did the maximum possible.</p>
  216. <p>In other cases you can use existing functionality and libraries (e.g. <code class="docutils literal notranslate"><span class="pre">baangt</span></code> support valid IBAN/BIC creation
  217. dynamically out-of-the-box) to create valid test data and find errors long before your customers do. If you come
  218. across the need for data, that is difficult to obtain (but legal!), contact us with a feature request on the public
  219. issue tracker. Maybe somebody will pick it up and provide a solution in <code class="docutils literal notranslate"><span class="pre">baangt</span></code> base functionality.</p>
  220. </td>
  221. </tr>
  222. </tbody>
  223. </table>
  224. </div>
  225. <div class="section" id="tl-dr">
  226. <h2>tl;dr<a class="headerlink" href="#tl-dr" title="Permalink to this headline">¶</a></h2>
  227. <p>Build realistic synthetic data for your regression tests and take good care of it. Also, for every bug found in production
  228. enhance your test set!</p>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. <footer>
  234. <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
  235. <a href="BaangtIndustries.html" class="btn btn-neutral float-right" title="baangt In Industries" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
  236. <a href="ProductionSucks.html" class="btn btn-neutral float-left" title="Why your production sucks and how to fix it" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
  237. </div>
  238. <hr/>
  239. <div role="contentinfo">
  240. <p>
  241. &copy; Copyright 2020, Bernhard Buhl
  242. </p>
  243. </div>
  244. Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
  245. </footer>
  246. </div>
  247. </div>
  248. </section>
  249. </div>
  250. <script type="text/javascript">
  251. jQuery(function () {
  252. SphinxRtdTheme.Navigation.enable(true);
  253. });
  254. </script>
  255. </body>
  256. </html>