{"id":136,"date":"2011-01-27T03:06:55","date_gmt":"2011-01-27T10:06:55","guid":{"rendered":"https:\/\/www.zacwitte.com\/?p=136"},"modified":"2011-01-27T03:06:55","modified_gmt":"2011-01-27T10:06:55","slug":"a-false-sense-of-security-with-test-driven-development","status":"publish","type":"post","link":"https:\/\/zacwitte.com\/?p=136","title":{"rendered":"A False Sense of Security with Test-driven Development"},"content":{"rendered":"<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; min-height: 15.0px} -->Test driven development is great as long as you have proper tests. The problem is that it&#8217;s very hard to predict enough edge cases to cover the field of possible scenarios. Code coverage analysis will help developers make sure all code blocks are executed, but it doesn&#8217;t do anything to ensure an application correctly handles the variations in data, user interaction, failure scenarios, or how it behaves under different stress conditions.<\/p>\n<p>The fact that tests are helpful, but never complete is something most developers are already conscious of.\u00a0The danger is that better tests make worse developers!\u00a0It&#8217;s very easy to lean too heavily on passing tests, wildly changing code until the light goes green without spending enough time thinking through the application&#8217;s logic.<\/p>\n<p>I&#8217;m basically saying that, psychologically speaking, passing tests gives us a false sense of security. They can be a distraction from carefully crafted and thought through code. That&#8217;s why I advocate writing tests only for the purposes of regression testing. It should be a follow-up step, not an integral part of initial development.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Test driven development is great as long as you have proper tests. The problem is that it&#8217;s very hard to predict enough edge cases to cover the field of possible scenarios. Code coverage analysis will help developers make sure all code blocks are executed, but it doesn&#8217;t do anything to ensure an application correctly handles [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[23,25],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-tech","tag-tdd","tag-test-driven-development"],"_links":{"self":[{"href":"https:\/\/zacwitte.com\/index.php?rest_route=\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zacwitte.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zacwitte.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zacwitte.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zacwitte.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=136"}],"version-history":[{"count":0,"href":"https:\/\/zacwitte.com\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions"}],"wp:attachment":[{"href":"https:\/\/zacwitte.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zacwitte.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zacwitte.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}