{"id":63,"date":"2012-09-20T05:03:31","date_gmt":"2012-09-20T05:03:31","guid":{"rendered":"http:\/\/www.infosynergetics.com\/?p=63"},"modified":"2014-05-16T05:05:18","modified_gmt":"2014-05-16T05:05:18","slug":"old-habits","status":"publish","type":"post","link":"https:\/\/www.infosynergetics.com\/?p=63","title":{"rendered":"Old Habits"},"content":{"rendered":"<p>I have <a href=\"http:\/\/infosynergetics.blogspot.com\/2012\/06\/i-have-seen-light.html\" target=\"_blank\">written<\/a> recently about my discovery of testing when developing code, and of test driven development.&nbsp; At the time, I was amazed at how well it revealed unused code as well as bugs in the code that is being used.&nbsp; Unfortunately, I have also discovered that testing is a discipline.&nbsp; Like any other discipline, it is one that you have to work at establishing, and you need to work to maintain it.<\/p>\n<p>I came to a spot while working on the <a href=\"https:\/\/github.com\/sciCloud\/LiMSpec\" target=\"_blank\">LiMSpec<\/a> project where I was trying to develop some unique code, and simply stopped writing new tests, and completely avoided running the existing tests while I was busily &#8220;hacking.&#8221;&nbsp; I had reverted to my old bad habits established from 20 years of coding in everything from Assembly Language on up the complexity tree.&nbsp; Code, code, code, then maybe document, then maybe design.&nbsp; Test only when everything is done.<\/p>\n<p>Surprisingly&#8230; okay, not surprising at all, I had broken various things in the process.&nbsp; The only way I knew this was when I ran tests to generate a coverage report.&nbsp; So I&#8217;ve now gone back and fixed the broken parts, and have extended the existing test suite.&nbsp; There is still more work to be done.&nbsp; I&#8217;d like to get close to 100% coverage, but am only at about 85% right now (I think it might actually be quite a bit higher as RCov seems to have missed many places where the code has been run in a test but is not being captured), and will seek to get there during the second release.&nbsp; In the meantime, I&#8217;m going to try to force myself to move much more toward the Test Driven Development approach &#8211; where the tests are written first, then the code written to pass the tests.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have written recently about my discovery of testing when developing code, and of test driven development.&nbsp; At the time, I was amazed at how well it revealed unused code as well as bugs in the code that is being used.&nbsp; Unfortunately, I have also discovered that testing is a discipline.&nbsp; Like any other discipline, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=\/wp\/v2\/posts\/63"}],"collection":[{"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=63"}],"version-history":[{"count":1,"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infosynergetics.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}