{"id":800,"date":"2007-03-10T18:10:43","date_gmt":"2007-03-10T08:10:43","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/2007\/03\/10\/code-size-of-an-engine-versus-test-suite\/"},"modified":"2009-02-21T13:51:09","modified_gmt":"2009-02-21T03:51:09","slug":"code-size-of-an-engine-versus-test-suite","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2007\/03\/10\/code-size-of-an-engine-versus-test-suite\/","title":{"rendered":"Code size of an engine versus test suite"},"content":{"rendered":"<p>If you count the lines of code in the MySQL Cluster (NDB) test suite (mysql-5.1\/storage\/ndb\/test &#8211; and exclude the old ODBC stuff) you come up with about 104000 lines of code. This is in contrast to the approximate other 350,000 lines of code for the NDB engine (excluding the handler, which is an additional 12,000 lines &#8211; this isn&#8217;t tested much by the NDB test suite&#8230; mysql-test-run.pl is meant to take care of a lot of that).<\/p>\n<p>If you go and check the MyISAM tree, it&#8217;s only 40545 lines of code &#8211; for the entire engine. That&#8217;s right, the MySQL Cluster test suite is about 2.5 times the size of MyISAM.<\/p>\n<p>If you look at mysql-test-run.pl tests, which are just lists of SQL commands with static data, it comes up at 250,000 lines (that excludes result files). The NDB tests do things programmatically &#8211; so can generate large amounts of data and different loads quite easily.<\/p>\n<p>The architecture of the NDB tests (commonly referred to as autotest, ATRT or HUGO framework) is very different from mysql-test-run.pl &#8211; it easily allows you to write a test that is high on concurrency, high on load and high on amount of data. It also is modular, so that when you get an issue from a customer (or need to do some benchmarking on a speficic type of schema) you can use the utility programs to help you (e.g. there&#8217;s one that does random PK updates to tables, one that does scans, one that does index operations etc).<\/p>\n<p>There&#8217;s this whole bunch of things you just cannot do with mysql-test-run.pl.<\/p>\n<p>Then we get to fault injection&#8230; MySQL Cluster is a distributed system that is designed to withstand failure. Without testing this, we can never say it&#8217;s remotely HA. So we test it. A lot. We inject failures into nodes to check our node failure handling, using the utility programs and some basic shell it&#8217;s possible to do custom tests (such as multi-node failure)\u00c2\u00a0 where our test suite doesn&#8217;t have the best coverage yet.<\/p>\n<p>Again, either not possible or extremely hard with mysql-test-run.pl<\/p>\n<p>mysql_slap is the hint of a nice utility to help in testing&#8230; but using it in mysql-test-run.pl scripts in a verifyable way (i.e. check what came out is what went in, using a variety of access methods &#8211; full table scans, pk scans, index scans, stored procs, cursors, views, joins etc) is tricky at best (but really impossible).<\/p>\n<p>Yes, I&#8217;m really pining for a better test suite infrastructure for the MySQL Server &#8211; it can only lead to better quality software&#8230;. almost somebody just rewriting a bunch of the hugo classes to use the MySQL C API would be useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you count the lines of code in the MySQL Cluster (NDB) test suite (mysql-5.1\/storage\/ndb\/test &#8211; and exclude the old ODBC stuff) you come up with about 104000 lines of code. This is in contrast to the approximate other 350,000 &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2007\/03\/10\/code-size-of-an-engine-versus-test-suite\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[14],"tags":[131,54,130],"class_list":["post-800","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-myisam","tag-ndb","tag-test"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-cU","jetpack-related-posts":[{"id":1636,"url":"https:\/\/www.flamingspork.com\/blog\/2009\/05\/15\/size-of-storage-engines\/","url_meta":{"origin":800,"position":0},"title":"Size of Storage Engines","author":"Stewart Smith","date":"2009-05-15","format":false,"excerpt":"For whatever reason, let's look at \"Total Physical Source Lines of Code\" from a recent mysql-6.0 tree (and PBXT from PBXT source repo): See the spreadsheet here. Raw data: Blackhole\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 336 CSV\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1143 Archive\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2960 MyISAM\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 34019 PBXT\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 41732 Maria\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 69019 InnoDB\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 82557 Falcon\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 91158 NDB\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 365272 NDB has a\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"http:\/\/spreadsheets.google.com\/pub?key=r_gtZ-mKTsbSlp6anfnACXw&oid=1&output=image","width":350,"height":200},"classes":[]},{"id":3304,"url":"https:\/\/www.flamingspork.com\/blog\/2013\/05\/13\/the-mysql-cluster-storage-engine\/","url_meta":{"origin":800,"position":1},"title":"The MySQL Cluster storage engine","author":"Stewart Smith","date":"2013-05-13","format":false,"excerpt":"This is one close to my heart. I've recently written on other storage engines:\u00c2\u00a0Where are they now: MySQL Storage Engines,\u00c2\u00a0The MERGE storage engine: not dead, just resting\u00e2\u20ac\u00a6. or forgotten\u00c2\u00a0and The MEMORY storage engine. Today, it's the turn of MySQL Cluster. Like InnoDB, MySQL Cluster started outside of MySQL. Those of\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1229,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/10\/14\/mysql-cluster-ndb-on-win32-progress\/","url_meta":{"origin":800,"position":2},"title":"MySQL Cluster (NDB) on Win32 progress","author":"Stewart Smith","date":"2008-10-14","format":false,"excerpt":"Many things have been happenning in the land of NDB on Win32 as of late. I've fixed about 700 compiler warnings (some of which were real bugs) leaving about 161 to go on Win32 (VS2003). We're getting a few more warnings on Win64 (some of which look merely semantic, while\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1199,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/09\/08\/building-mysql-on-windows-mysql-forge-wiki\/","url_meta":{"origin":800,"position":3},"title":"Building MySQL on Windows &#8211; MySQL Forge Wiki","author":"Stewart Smith","date":"2008-09-08","format":false,"excerpt":"Building MySQL on Windows - MySQL Forge Wiki This one covers running mysqld in the VisualStudio debugger, which can be useful. I have no special ndb_mgmd.exe or ndbd.exe in debugger instructions or wisdom (running them from mysql-test-run.pl at least). I've attached debugger to already running (started by mysql-test-run.pl) ndb processes,\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":847,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/06\/19\/my-top-5-wishlist-for-mysql\/","url_meta":{"origin":800,"position":4},"title":"My Top 5 Wishlist for MySQL","author":"Stewart Smith","date":"2007-06-19","format":false,"excerpt":"I'm going and stealing Jay's idea (who stole it off Brian Duff... but his was for Oracle so obviously doesn't count :) So, my five wishes for MySQL Are: 5. Six-monthly release cycles Getting a release out there takes way too long. There's a variety of reasons, but seeing the\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":904,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/10\/16\/mysql-5122ish-stew1\/","url_meta":{"origin":800,"position":5},"title":"MySQL 5.1.22(ish)-stew1","author":"Stewart Smith","date":"2007-10-16","format":false,"excerpt":"I've decided to publish my patch series. The goal of the -stew patches is to collect things I find interesting and that at some point could (should) make it into the main MySQL tree (even if others don't think so). It's not designed for use in production.. I don't really\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=800"}],"version-history":[{"count":2,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/800\/revisions"}],"predecessor-version":[{"id":1521,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/800\/revisions\/1521"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}