{"id":1031,"date":"2013-04-23T15:20:06","date_gmt":"2013-04-23T21:20:06","guid":{"rendered":"http:\/\/www.mooreds.com\/wordpress\/?p=1031"},"modified":"2014-09-13T08:40:39","modified_gmt":"2014-09-13T14:40:39","slug":"testing-with-pentaho-kettle-what-to-test","status":"publish","type":"post","link":"https:\/\/www.mooreds.com\/wordpress\/archives\/1031","title":{"rendered":"Testing with Pentaho Kettle &#8211; what to test"},"content":{"rendered":"<p>This article is part of a series.\u00a0 Here&#8217;s the first part, explaining the <a href=\"\/wordpress\/archives\/995\">benefits of automated testing for ETL jobs<\/a>.<\/p>\n<p>Especially since you have to manually create a test harness for each type of transformation, it is an effort to create a testsuite.\u00a0 So, what should you test?<\/p>\n<p>You should test ETL code that is:<\/p>\n<ul>\n<li>complex<\/li>\n<li>likely to change over time<\/li>\n<li>key to what you are doing<\/li>\n<li>will fail in subtle ways<\/li>\n<\/ul>\n<p>So, for instance, I don&#8217;t test code that loads data from a file.\u00a0 I do test business logic.\u00a0 I don&#8217;t test code that reads from a database or writes to a database.\u00a0 I do test anything that has a <a href=\"http:\/\/wiki.pentaho.com\/display\/EAI\/Filter+rows\">Filter rows<\/a> step in it.\u00a0 I don&#8217;t test connectivity to needed resources, because I think a failure there would be spectacular enough that our ops team will notice.\u00a0 I do test anything I think might change in the future.<\/p>\n<p>It&#8217;s a balancing act, and choosing what to test or not to test can become an excuse for not testing at all.<\/p>\n<p>So, if this decision is overwhelming, but you want to try automated testing, pick a transform with logic that you currently maintain, refactor it to accept input from a <a href=\"http:\/\/wiki.pentaho.com\/display\/EAI\/Get+rows+from+result\">Get rows from result<\/a> step (or if your dataset is large enough that you get OutOfMemory errors with this step, <a href=\"http:\/\/wiki.pentaho.com\/display\/EAI\/Serialize+to+file\">serialize<\/a>\/<a href=\"http:\/\/wiki.pentaho.com\/display\/EAI\/De-serialize+from+file\">de-serialize<\/a> the data) and wrap it with a test suite.\u00a0 When you think of another &#8220;interesting&#8221; set of data, add that to the suite. See if this gives you more confidence to change the transformation in question.<\/p>\n<p>In the next post, we&#8217;ll start building out such a testing framework.<\/p>\n<p>Signup for my <a href=\"http:\/\/eepurl.com\/x2Biz\">infrequent emails about pentaho testing<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is part of a series.\u00a0 Here&#8217;s the first part, explaining the benefits of automated testing for ETL jobs. Especially since you have to manually create a test harness [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63,58],"tags":[],"class_list":["post-1031","post","type-post","status-publish","format-standard","hentry","category-pentaho-data-integration","category-testing"],"_links":{"self":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1031"}],"version-history":[{"count":7,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1031\/revisions"}],"predecessor-version":[{"id":1755,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/posts\/1031\/revisions\/1755"}],"wp:attachment":[{"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mooreds.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}