{"id":230,"date":"2011-01-07T09:45:08","date_gmt":"2011-01-07T16:45:08","guid":{"rendered":"http:\/\/journeyman.ivystreetinc.com\/?p=230"},"modified":"2011-01-08T07:36:30","modified_gmt":"2011-01-08T14:36:30","slug":"tdd-lets-put-my-finger-on-it","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=230","title":{"rendered":"TDD: Not For Design"},"content":{"rendered":"<p>Recently I was having a discussion about NoSQL and Relational Databases.\u00a0 The positions are so <em>divided<\/em>.\u00a0 It always harkens back to the day when parallel and linear processing were raging in battle against each other.<\/p>\n<p>So tell me, do you multi-thread your apps that much?\u00a0 How about in a method?\u00a0 Why not?\u00a0 right.\u00a0 Cause you don&#8217;t need to.\u00a0 Parallel and linear processing have their places.\u00a0 So do NoSQL and RelationDB&#8217;s.\u00a0 And so does TDD.<\/p>\n<p>TDD stand for test driven development.\u00a0 There are times I&#8217;ve heard the word &#8220;design&#8221; substituted for development.\u00a0 There are still people banging Khrushchev&#8217;s shoe on the cube and screaming &#8220;WE MUST DO TDD&#8221;!!!!! \u00a0 Because they think it is the best way to code an application.\u00a0 It will dictate your design, which will be rock solid because you have done TDD!<\/p>\n<p>Great, in theory, on the surface.<\/p>\n<p>TDD vs.\u00a0 well &#8212; Test after?\u00a0 Is also one of those dead end arguments.\u00a0\u00a0 They are just merely tools.\u00a0 Try as a TDD Cleric might try, its just a damn tool to use and is not well suited for most design work.\u00a0 I&#8217;m sorry, its not.\u00a0 But some still people use it to do design for their code.\u00a0\u00a0 And development is a creative effort.\u00a0\u00a0\u00a0\u00a0 Development is not typing fancy.<\/p>\n<p>The reason TDD is poor for design is tough to grasp; because it takes more insight than a sound byte or a simple dismissal.\u00a0\u00a0 The reason comes after a long time of trying TDD, and finally having that aha moment.\u00a0\u00a0\u00a0 it reminds me very much of putting tarragon on fruit loops.\u00a0\u00a0 You eat the fruit loops and something just doesn&#8217;t taste right.\u00a0 And you don&#8217;t know what it is, just something.\u00a0 If you happen to like tarragon on your fruit loops, then I suggest instead imagine coco puffs with rabbit shit.\u00a0\u00a0 Mmmmm delicious rabbit puffs . . .<\/p>\n<p>TDD doesn&#8217;t work because the tests are not the source behavior of the application.\u00a0\u00a0 I am sorry but they are not.\u00a0 You can code the tests first, but before that, the application had already existed in the form of a requirement or more likely, someone&#8217;s mind.\u00a0 <em>The application already exists before the tests so it is already designed. <\/em><\/p>\n<p>A BA didn&#8217;t come along and say &#8220;I think our business needs a set of test suites for customer registration.&#8221;\u00a0 Nope.<\/p>\n<p>They wanted customer registration.\u00a0 The test doesn&#8217;t dictate where the entry fields are, where the submit button is &#8212; all that comes <em>after <\/em>the real design and\u00a0 merely tests that it matches the criteria.\u00a0 That&#8217;s it.\u00a0 NOTHING is driven by the tests.\u00a0 In fact, the idea of &#8220;driven&#8221; becomes silly in that context.\u00a0 Driven implies &#8220;first.&#8221;\u00a0 And the tests are not first.<\/p>\n<p>Between the requirements and the translation of them into code, which may be tests, there weren&#8217;t tests.\u00a0 <strong>The tests are derivative.<\/strong><\/p>\n<p>Now let me support this with field data.\u00a0 I have talked to 4 places in the last month that all state they are a TDD shop on paper.\u00a0 But when you look at their code, when you talk to them &#8212; well, they aren&#8217;t doing it!\u00a0\u00a0 They have those zealot TDD programmers onsite that will kill you if you speak out against Ruby and even they aren&#8217;t doing it. all the time.<\/p>\n<p>In fact, a huge problem in the development world is that we do not get time to re-factor properly &#8212; the business does not want to pay for it and eats the technical debt.\u00a0 TDD then in fact becomes a deterrent to re-factoring because it takes more time with more code.<\/p>\n<p>The idea of TDD is good, as a tool.\u00a0\u00a0 It&#8217;s nice as a way to supplement the quality of your code, or to help decide if there are patterns.\u00a0 You have to be willing to throw whole sets of tests out for re-factors; and a lot of people won&#8217;t do that so like a distributed repository it never really gets\u00a0 properly practiced.<\/p>\n<p>But TDD is not suited for most design and never will be.\u00a0 The world is not manifested like that.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I was having a discussion about NoSQL and Relational Databases.\u00a0 The positions are so divided.\u00a0 It always harkens back to the day when parallel and linear processing were raging in battle against each other. So tell me, do you multi-thread your apps that much?\u00a0 How about in a method?\u00a0 Why not?\u00a0 right.\u00a0 Cause you [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/230"}],"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=230"}],"version-history":[{"count":7,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":233,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/230\/revisions\/233"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}