{"id":1114,"date":"2014-05-20T10:19:36","date_gmt":"2014-05-20T17:19:36","guid":{"rendered":"http:\/\/10kdev.net\/?p=1114"},"modified":"2014-06-05T09:02:11","modified_gmt":"2014-06-05T16:02:11","slug":"ec-tech-meetup-may-20-2014-was-tdd-a-qa-coup-detat","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=1114","title":{"rendered":"EC Tech Meetup May 20, 2014 &#8211; Was TDD a QA Coup d&#8217;etat?"},"content":{"rendered":"<p><strong>Tonight is the next installment of \u00a0*hands on* for our local group. \u00a0With brewskies and Crown Royal.<\/strong><\/p>\n<p>There will be testing exercises and some TDD kata, and discussing the efficacy of TDD in coding with today&#8217;s modern methodologies.<\/p>\n<p>A lot of you have noted there has been a (predictable) backlash against TDD. \u00a0 \u00a0My earliest memories of the methodology were of zealot\/half coders from QA spitting bologna sandwich bits on our shiny developer faces while they told us we were all wrong about how we thought about software. \u00a0 I personally worked on sites where directors argued that QA=Developer in a sprint. \u00a0 Now when I look back I see that part of the evolution as a coup; that QA was trying to take over the development process by trying to argue that the creation process was nothing more than translating requirements and tests to code. \u00a0It sounded great in a manifesto . . . . but didn&#8217;t work in practice like so many other manifestos. \u00a0Eventually, and to this day,\u00a0non-coding management uses \u00a0TDD as an bludgeon for their inquisition &#8212; the usual spiral to not so much build software as to set up a CYA network and pre-empt blame. \u00a0Good old pre-emptive blame, another Agile methodology.<\/p>\n<p>Then, as now, we have argued TDD is merely a technique for the tool box. \u00a0Yes test, but I wasn&#8217;t ready to drill a hole into my engine block to test block temps just yet. \u00a0And software is not a set of tests, its a set of something that does something &#8211; for <em>people<\/em>.<\/p>\n<p>That aside, the tasks on-hand will be this kata I gleaned from <a href=\"http:\/\/osherove.com\/tdd-kata-1\/\">Roy Osherove&#8217;s<\/a> site with many, many thank yous.<\/p>\n<h2 style=\"padding-left: 30px;\">String Calculator<\/h2>\n<p style=\"padding-left: 30px;\">The following is a TDD Kata- an exercise in coding, refactoring and test-first, that you should apply daily for at least 15 minutes (I do 30).<\/p>\n<h2 style=\"padding-left: 30px;\">Before you start:<\/h2>\n<ul style=\"padding-left: 30px;\">\n<li style=\"padding-left: 30px;\">Try not to read ahead.<\/li>\n<li style=\"padding-left: 30px;\">Do one task at a time.\u00a0The trick is to learn to work incrementally.<\/li>\n<li style=\"padding-left: 30px;\">Make sure you only test for<strong>\u00a0correct inputs<\/strong>. there is no need to test for invalid inputs for this kata<\/li>\n<\/ul>\n<p style=\"padding-left: 30px;\"><strong>String Calculator<\/strong><\/p>\n<ol style=\"padding-left: 30px;\">\n<li style=\"padding-left: 30px;\">Create a simple String calculator with a method\u00a0<strong>int Add(string numbers)<\/strong>\n<ol style=\"padding-left: 30px;\">\n<li style=\"padding-left: 30px;\">The method can take 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example<strong>\u00a0\u201c\u201d or \u201c1\u201d or \u201c1,2\u201d<\/strong><\/li>\n<li style=\"padding-left: 30px;\">Start with the simplest test case of an empty string and move to 1 and two numbers<\/li>\n<li style=\"padding-left: 30px;\">Remember to solve things as simply as possible so that you force yourself to write tests you did not think about<\/li>\n<li style=\"padding-left: 30px;\">Remember to refactor after each passing test<\/li>\n<\/ol>\n<\/li>\n<li style=\"padding-left: 30px;\">Allow the Add method to handle an unknown amount of numbers<\/li>\n<li style=\"padding-left: 30px;\">Allow the Add method to handle new lines between numbers (instead of commas).\n<ol style=\"padding-left: 30px;\">\n<li style=\"padding-left: 30px;\">the following input is ok:\u00a0 \u201c1\\n2,3\u201d\u00a0 (will equal 6)<\/li>\n<li style=\"padding-left: 30px;\">the following input is NOT\u00a0ok:\u00a0 \u201c1,\\n\u201d (not need to prove it &#8211; just clarifying)<\/li>\n<\/ol>\n<\/li>\n<li style=\"padding-left: 30px;\"><strong>Support different delimiters<\/strong>\n<ol style=\"padding-left: 30px;\">\n<li style=\"padding-left: 30px;\">to change a delimiter, the beginning of the string will contain a separate line that looks like this:\u00a0\u00a0 \u201c\/\/[delimiter]\\n[numbers\u2026]\u201d for example \u201c\/\/;\\n1;2\u201d should return three where the default delimiter is \u2018;\u2019 .<\/li>\n<li style=\"padding-left: 30px;\">the first line is optional. all existing scenarios should still be supported<\/li>\n<\/ol>\n<\/li>\n<li style=\"padding-left: 30px;\">Calling Add with a negative number will throw an exception \u201cnegatives not allowed\u201d &#8211; and the negative that was passed.if there are multiple negatives, show all of them in the exception message<br \/>\n<hr style=\"padding-left: 30px;\" \/>\n<p><strong>stop here if you are a beginner<\/strong>. Continue if you can finish the steps so far in less than 30 minutes.<\/p>\n<hr style=\"padding-left: 30px;\" \/>\n<\/li>\n<li style=\"padding-left: 30px;\">Numbers bigger than 1000 should be ignored, so adding 2 + 1001 \u00a0= 2<\/li>\n<li style=\"padding-left: 30px;\">Delimiters can be of any length with the following format:\u00a0 \u201c\/\/[delimiter]\\n\u201d for example: \u201c\/\/[***]\\n1***2***3\u201d should return 6<\/li>\n<li style=\"padding-left: 30px;\">Allow multiple delimiters like this:\u00a0 \u201c\/\/[delim1][delim2]\\n\u201d for example \u201c\/\/[*][%]\\n1*2%3\u201d should return 6.<\/li>\n<li style=\"padding-left: 30px;\">make sure you can also handle multiple delimiters with length longer than one char<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Tonight is the next installment of \u00a0*hands on* for our local group. \u00a0With brewskies and Crown Royal. There will be testing exercises and some TDD kata, and discussing the efficacy of TDD in coding with today&#8217;s modern methodologies. A lot of you have noted there has been a (predictable) backlash against TDD. \u00a0 \u00a0My earliest [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1114"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1114"}],"version-history":[{"count":3,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1114\/revisions"}],"predecessor-version":[{"id":1117,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1114\/revisions\/1117"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1114"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}