{"id":427,"date":"2022-02-14T18:56:45","date_gmt":"2022-02-14T10:56:45","guid":{"rendered":"https:\/\/www.fanyamin.com\/wordpress\/?p=427"},"modified":"2022-02-14T18:56:51","modified_gmt":"2022-02-14T10:56:51","slug":"the-three-rules-of-tdd","status":"publish","type":"post","link":"https:\/\/www.fanyamin.com\/wordpress\/?p=427","title":{"rendered":"The Three Rules of TDD"},"content":{"rendered":"<p>Robert C. Martin (\u201cUncle Bob\u201d) provides a concise set of rules for practicing TDD.<\/p>\n<ol>\n<li>\n<p>Write production code only to pass a failing unit test.<\/p>\n<\/li>\n<li>\n<p>Write no more of a unit test than sufficient to fail (compilation failures are failures).<\/p>\n<\/li>\n<li>\n<p>Write no more production code than necessary to pass the one failing unit test.<\/p>\n<\/li>\n<\/ol>\n<p>Rule #1 says to write tests first\u2014understand and specify, in the form of a unit test example, behavior you must build into the system.<\/p>\n<p>Rule #2 says to proceed as incrementally as possible\u2014after each line you write, get feedback (via compilation or test run) if you can before moving on. When test-driving a RetweetCollection class, we stop as soon as we write this much of a first test:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Robert C. Martin (\u201cUncle Bob\u201d) provides a concise set of rules for practicing TDD. Write production code only to pass a failing unit test. Write no more of a unit test than sufficient to fail (compilation failures are failures). Write no more production code than necessary to pass the one failing unit test. Rule #1 [&hellip;] <a class=\"read-more\" href=\"https:\/\/www.fanyamin.com\/wordpress\/?p=427\" title=\"Permanent Link to: The Three Rules of TDD\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-427","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/427"}],"collection":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=427"}],"version-history":[{"count":1,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/427\/revisions"}],"predecessor-version":[{"id":428,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/427\/revisions\/428"}],"wp:attachment":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}